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]]>mrjt2007-08-30T09:53:55-00:00Re: Time and Date
https://www.ultimatepp.org/forums/index.php?t=rview&goto=11280&th=2684#msg_11280
In fact, the main purpose of both Date and Time structs is that they understand calendar...
As for Time representing just time in day, well, maybe it would be sound design choice, however, right now, it is too late for such radical change. If number of second is not going to help here, we have to invent some new name, like "TimeInDay" or something...
Mirek
]]>mirek2007-08-30T14:27:59-00:00food for thought [was: Time and Date]
https://www.ultimatepp.org/forums/index.php?t=rview&goto=11283&th=2684#msg_11283
When modeling events over geological timeframes you can run into some odd things where you know that an event happened in the morning (because a flower that only blooms in the morning, during about a given month) was embedded into sediment. From this you can deduce the sample was "collected/fixed" April 15 (+/-15 days), 7:00am (+/-1:00) 25,000 BCE (+/- 5,000)... How do you represent various errors and/or ranges... At the moment I have a bunch of LIDAR processing I am working towards and need to be able to track the real-time laser shots down to the us or finer.
Also, there are numerous calendars and actually different ways to measure time (sorry I do not have the references on me but I might be able to point you to them if interested). So there is an implied issue of separating the presentation from the actual date/time variable.
In the end, it is very difficult to design a widely applicable date/time parser/module. I would first ask what your applications are.
Anyway, food for thought.
EBo --]]>ebojd2007-08-30T17:38:08-00:00Re: food for thought [was: Time and Date]
https://www.ultimatepp.org/forums/index.php?t=rview&goto=11290&th=2684#msg_11290
ebojd wrote on Thu, 30 August 2007 18:38
Anyway, food for thought.
A feast
I agree with both of you. It's definitely impractical to fundamentally change the current Date/Time structure - besides the large amount of work this would break far to much code - and I agree that it's futile attempting to devise a design that is going to be applicable to all situations.
My concern really originates from the fact that currently Upp handles this issue is a very unfriendly way. EditTime in particular doesn't do what you'd expect it to and is essentially useless (I can't think of any reason why you would want to use it instead of two seperate Time/Date fields). And because of the EditField/Convert concept the reason and solution to this is not obvious to new users.
Do you think it would be feasible to change EditTime to return the number of seconds and only accept times? The change is easy to make, but does anyone already use it?
I know this a relatively minor issue, but I've got a bee in bonnet about it now, and I think it's in everyone interest to make Upp as good and easy to learn as possible.
James
EDIT: Changed my mind obout some stuff...]]>mrjt2007-08-31T10:38:25-00:00Re: food for thought [was: Time and Date]
https://www.ultimatepp.org/forums/index.php?t=rview&goto=11305&th=2684#msg_11305
Maybe EditTimeSpan?