[Zope3-dev] mini-RFC: times and timezones

Martijn Faassen faassen at infrae.com
Fri Feb 25 17:57:22 EST 2005


Gary Poster wrote:
[snip]
> Other observations:
> - Working internally with utc datetimes is considered best practice[4].  
>  The Zope 3 code base does store UTC dates, just without a timezone.

My gut feeling is that it would make sense to store UTC only and convert 
on intput and output.

My gut feeling is based on similar pattern as the one used with unicode 
strings. Mixing unicode and non-unicode strings can lead to bugs at 
random places in the codebase and to ugly hackery to suppress such bugs. 
It can be seen with Zope 2 unicode aware code.

There are some use cases for timezone independent datetime, such as 
having an appointment across the atlantic and not wanting to see it's at 
3 am while it's really at 9 am. This can be fixed by judicious use of 
display hints too; you could have a datetime display in the timezone it 
is saved in. This requires an explicit storing of timezone information 
in this particular case, but that may be worthwhile.

Regards,

Martijn



More information about the Zope3-dev mailing list