
On 06 July 2005 12:01, Tony Finch wrote:
On Wed, 6 Jul 2005, Simon Marlow wrote:
I just had a little look around, mainly at System.Time.Calendar. I think the structure is rather complicated - I wanted to find out how to get a CalendarTime for "this time tomorrow", and ended up with this:
"this time tomorrow" is not well-defined. What happens then the clocks change?
It's well-defined unless the current time doesn't exist tomorrow, which can happen if a DST switch or leap second happens. In these cases I'd expect either (a) a sensible rollover, or (b) an error, or possibly both behaviours to be available. The question is, what's the result of encodeUTC for an invalid CalendarTime. Does it roll over the out-of-range fields? What happens if you ask for Feb 29 in a non-leap year, for example? Cheers, Simon