On 10 Jul 2014, at 23:26, Esteban A. Maringolo <emaring...@gmail.com> wrote:

> What is the best way to work across timezones?
> 
> Today my app assumes a global, shared, timezone for data input, storage, etc.
> I want to make this configurable, and for that purpose I
> 
> For what I read and thought about, I understand that the best way to
> avoid any complication is to store and transfer (between
> client/server) everything in UTC, and use timezone offset only to
> convert to/from in order to display the Date and Time.
> 
> Does anybody have a good article regarding working across timezones?
> Any tip or suggestion for its use with PostgreSQL and GLORP?
> 
> Thanks in advance.
> 
> Esteban A. Maringolo
> 
> ps: And I guess I now understand the purpose of ZTimestamp :)

;-)

Not only that, there is also ZTimezone with support for the Olsen timezone 
database.

Note that going from local time to UTC and vice versa depends not just on the 
TZ but also on the timestamp itself (DST transitions), with possible gaps and 
doubles (turn the clock forward/backward), making durations across the DST 
transition weird ;-)

Furthermore, a date (or start/end of a day) is also TZ dependent (Saturday 
starts earlier/later for me than for you). For example, 'notify me if something 
happens on Monday' is trickier than it would seem.

Even though Norbert is right that you can use/mix any/all timezones, the only 
way to remain sane, IMHO, is to store everything in UTC and only convert to 
local TZ when presenting (this can be really on the client like you suggest or 
in Seaside or reporting code on the server). You will  also need more the just 
a global setting, you need this per session !

Anyway, this is how we do it.

Sven


Reply via email to