Subject Re: [firebird-support] Re: GMT time in Firebird
Author Lester Caine
Adam wrote:
> --- In firebird-support@yahoogroups.com, Lester Caine <lester@...> wrote:
>> Adam wrote:
>>> --- In firebird-support@yahoogroups.com, "Timothy Madden"
>>> <terminatorul@> wrote:
>>>> Hello
>>>>
>>>> Is there a way to get or deduce GMT time from the Firebird server, I
>>> mean
>>>> with SQL commands ?
>>> Not directly. You can write / find a UDF to achieve the same thing,
>>> but that is obviously harder if supporting multiple platforms.
>>>
>>> It is in the tracker as an enhancement request.
>>> http://tracker.firebirdsql.org/browse/CORE-909
>> The trick currently is to SET the local time on a server to UTC so
> that all
>> the times saved are UTC.
>
> A trick made much harder when a trigger like
>
> CREATE TRIGGER FOO_BU FOR FOO
> ACTIVE BEFORE UPDATE POSITION 0
> BEGIN
> NEW.CHANGED_AT = CURRENT_TIMESTAMP;
> END
>
> Sets the timestamp to the local time as seen by the server.

That is the point - you set the local time *TO* UTC on all the servers so they
all use the same clock ;)

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/lsces/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