Re: GTimeZoneBias (Linux)

Giganews Newsgroups
Subject: Re: GTimeZoneBias (Linux)
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Wed, 1 Dec 2004

"Dean" <dean@nospam-weany.com> wrote in message
news:19800C7852B6E240dean@nospam-weany.com...

> I'm trying to convert from time_t to TDateTime. I got this
> code from the net, but it seems to be 11 months out.

Untested:

    function SecondsToDateTime(seconds: Comp; gmt: integer): TDateTime;
    begin
        // convert seconds from 01/01/1970 to TDateTime format (GMT time)
        Result := EncodeDate(1970, 1, 1) + ((seconds-((-1)*gmt*60*60)) /
86400);
    end;

Gambit

Replies

In response to

GTimeZoneBias (Linux) posted by Dean on Wed, 1 Dec 2004