Subject Re: current_timestamp UTC UDF?
Author Adam
--- In firebird-support@yahoogroups.com, Lester Caine <lester@...> wrote:
>
> Richard Salt wrote:
> > Hi All
> >
> > Having searched the posts, I understand that Firebird doesn't include
> > a function such as current_timestamp_utc.
> >
> > Before I embark on attempting to write a UDF to do this, I thought I
> > would ask if any of you kind souls have already written one?
> >
> > Ultimately I will need this for both Linux AND Windows but, at this
> > time, just a Windows one will suffice.
> >
> > Any help much appreciated.

Yes, it would be useful.
http://tracker.firebirdsql.org/browse/CORE-909

But to implement as a UDF is not especially difficult. The Windows API
has GetSystemTime. In Delphi, there is a function SystemTimeToDateTime
to convert it to a TDateTime. You can convert that into the structure
that Firebird wants.

As Lester points out, UTC -> Local time is not always as simple as it
would seem.

Adam