Subject | RE: [firebird-support] How to convert TIMESTAMP to unix timestamp (number of seconds since epoch) |
---|---|
Author | Leyne, Sean |
Post date | 2009-06-09T21:13:53Z |
> Yes, AFAIK most systems that deal with time-zones incorporateGeoff,
> daylight-savings into the code... usually by assuming the
> operating system can tell it the local time-zone in much the
> same way they rely on it to tell them the local or utc time.
>
> The point is to record the timestamp as it was to the person
> or process that saved the timestamp. To normalise out the
> time-zone is to lose part of the original/source information.
> In some applications it does not matter, in some it does.
I agree but want to suggest that if it is necessary for a system to
commonly convert datetime values between timezones that storing the
values as UTC is the only real solution.
To expect that the time difference (offset) between 2 timezones is
constant is a gross misunderstanding of the Timezone rules.
1 - the definition of a timezone can change over time, that some
timezones can start/stop observing daylight-savings.
2 - the rules for daylight-savings can change overtime. Consider the
changes made for "energy savings" (actually didn't help much) a couple
of years ago. Further, in the case of Pakistan Standard Time, the dates
when the daylight-savings time change occurs can change on a yearly
basis.
Sean