Subject | Re: AW: [Firebird-Java] Timezones |
---|---|
Author | Lester Caine |
Post date | 2009-11-04T17:46:19Z |
Roman Rokytskyy wrote:
The second your client is in a different time zone there is a problem in
that you need to know how to display times for them, and the browser
'offset' does not provide daylight saving offsets.
What we decided in bitweaver ( yes I know it's PHP, but the problem is
the same ;) ) was to store everything UTC based, so that the server
simply runs UTC and NOW is always UTC based. We then display UTC time or
we display 'local time' based on the time zone the user provides as
part of their profile. Events created at one time in one local time zone
will then correctly map to the right time in another even taking into
account differences in daylight savin!
If your site is only ever accessed from the same timezone, then you can
get away not using simple UTC times, but as soon as daylight saving is
required, then the differences between the time at the client locations
needs to be managed fully?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
>> As far as I understand this, as long as I use setTimestamp/setDate andThe basic problem here has little to do with Firebird ;)
>> getTimestamp/getDate I should be safe to get the same information back,
>> INDEPENDENT of any timezone in the system, java or whatever?
>
> It creates you an appropriate timestamp (e.g. Wednesday, 4th od November
> 2009 17:49:35.005) for your _locale_ timezone (which for one client can
> be GMT+01, for another - GMT+05). If then, you do all computations in
> your local timezone and then save time back, it will be the same.
The second your client is in a different time zone there is a problem in
that you need to know how to display times for them, and the browser
'offset' does not provide daylight saving offsets.
What we decided in bitweaver ( yes I know it's PHP, but the problem is
the same ;) ) was to store everything UTC based, so that the server
simply runs UTC and NOW is always UTC based. We then display UTC time or
we display 'local time' based on the time zone the user provides as
part of their profile. Events created at one time in one local time zone
will then correctly map to the right time in another even taking into
account differences in daylight savin!
If your site is only ever accessed from the same timezone, then you can
get away not using simple UTC times, but as soon as daylight saving is
required, then the differences between the time at the client locations
needs to be managed fully?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php