Subject | Re: [firebird-support] UTC Time from server |
---|---|
Author | Lester Caine |
Post date | 2005-09-04T07:34:14Z |
Richard wrote:
the 'gmt' time rather than using 'NOW' when building the queries. The
other database engines supported by ADOdb all then get the same SQL for
'NOW'.
What we have found though is that the only reliable way to get UTC time
*IS* to set the clock of the servers to that time :( even though PHP
provides 'gm' versions of tools you still need to establish the ACTUAL
timezone offset.
And getting the 'local' time from the browsers so you can display the
correct time can be a bit hit and miss as well.
PHP are working on yet another rewrite of the TZ functions in the latest
builds of PHP5!
The one thing that I am sure of is that where a database is being
populated with data from round the world, the ONLY way to timestamp it
is with UTC time, especially if the data is then replicated to machines
across time zones! *SO* perhaps a UTC mode for NOW/CURRENT_TIMESTAMP
would be useful? If we can remove the OS differences in how it is
supplied ;)
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
>>>What SQL syntaxt would I use to retrieve the UTC time from a FirebirdNo bitweaver is PHP based and uses the ADOdb library. That just supplies
>>>1.5 server?
>>
>>Having just updated the birweaver codebase so that EVERYTHING is stored
>>as a UTC time, the display function was great fun. Just how do you cope
>>with a day view on a daylight savings day :)
>>
>>The ideal way of working with bitweaver now is to run the server CLOCK
>>as UTC and then you can select local or UTC as the client display.
>>
> Did you write a UDF to get this working Lester?
the 'gmt' time rather than using 'NOW' when building the queries. The
other database engines supported by ADOdb all then get the same SQL for
'NOW'.
What we have found though is that the only reliable way to get UTC time
*IS* to set the clock of the servers to that time :( even though PHP
provides 'gm' versions of tools you still need to establish the ACTUAL
timezone offset.
And getting the 'local' time from the browsers so you can display the
correct time can be a bit hit and miss as well.
PHP are working on yet another rewrite of the TZ functions in the latest
builds of PHP5!
The one thing that I am sure of is that where a database is being
populated with data from round the world, the ONLY way to timestamp it
is with UTC time, especially if the data is then replicated to machines
across time zones! *SO* perhaps a UTC mode for NOW/CURRENT_TIMESTAMP
would be useful? If we can remove the OS differences in how it is
supplied ;)
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services