Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Time and Date
Time and Date [message #11277] Thu, 30 August 2007 11:53 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I've been looking at making a patch to fix EditTime and and some other related stuff, but I've hit a serious problem - There is no way to represent just a time in Upp. For instance:
		Time t;
		t.hour = 14;
		t.minute = 13;
		t.second = 12;
		time <<= t;
		bool isvalid = t.IsValid();
		bool isnull = IsNull(t);
		String asstring = AsString(t);

Output:
isvalid = true
isnull = true
asstring = null

This is caused by:
template<> inline bool  IsNull(const Time& t)    { return t.year == -32768; }


Personally I think Date and Time should be seperated (and have an additional DateTime class) but can see this might be impractical at this stage. However, could this also be fixed by having a null state for Time (like minute or second >= 60) and test for that instead?

James

[Updated on: Thu, 30 August 2007 12:16]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NTL vs STL compatibility
Next Topic: 2 small Bugs [bug]
Goto Forum:
  


Current Time: Fri Apr 26 01:25:55 CEST 2024

Total time taken to generate the page: 0.07959 seconds