oship-dev team mailing list archive
-
oship-dev team
-
Mailing list archive
-
Message #01636
Re: Last issues about date/time classes
On Wed, 2010-12-01 at 21:10 -0200, Diego Manhães Pinheiro wrote:
> > Does that make sense?
> Yes, but I'm not totally convinced that partial date/time need to be
> handled with different units. Anyway, this approach doesn't allow
> compare a partial with a non-partial date/time without normalize the
> numbers everytime that a object date/time is compared to other date/time
> object.
I don't think that you have a legal use case for that kind of
comparison. If you really insist then you would have to normalize to
the partial datetime. Or in a case of two partials; to the one with the
larger of the available units. e.g.
The duration of:
1990-09-12T01:00 to 1990-09-13 would have to be an approximate duration
of one day. Even at that, you have to make the assumption that the TZ
was the same.
My decision is that attempting to compute a duration of two datetime
objects with different granularity is an undefined operation and should
return None (Void, Null, whatever you want to call it). I'll certainly
stay open for differing opinions on this but I think it is better to
move on. If someone pops up with a well understood standard way of
computing it then we can change it later.
Cheers,
Tim
Attachment:
signature.asc
Description: This is a digitally signed message part
References