Re: [Lazarus] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-31 Thread Reinier Olislagers
On 31-3-2012 2:56, João Marcelo Vaz wrote:
 2012/3/30 Reinier Olislagers reinierolislag...@gmail.com
 mailto:reinierolislag...@gmail.com
 On 30-3-2012 16:05, Frank Church wrote:
  Is there a function that returns the UTC time, either as a UnixTime or
  TDateTime irregardless of timezone?
 There is a separate unit that deals with this, IIRC, the wiki mentions
 it somewhere..
 
 Regards,
 Reinier
 
 PascalTZ does that.
 
 http://wiki.lazarus.freepascal.org/PascalTZ 

Thanks, João, that's the one I meant!

Reinier

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-31 Thread Felipe Monteiro de Carvalho
In the package lazutils there is:

unit lazutf8sysutils;

function NowUTC: TDateTime;
function GetTickCount64: QWord;


-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-31 Thread Frank Church
On 30 March 2012 15:05, Frank Church vfcli...@gmail.com wrote:
 When I get the time via the DateTime function result is adapted for
 the timezone, making it an hour ahead now?

 Is there a function that returns the UTC time, either as a UnixTime or
 TDateTime irregardless of timezone?

 --
 Frank Church

 ===
 http://devblog.brahmancreations.com

PascalTZ appears to be the most recommended one. I will go with it and
see. If it comes to the worst, I will consider looking up the time
from an NTP server to see how it compares as a check.

-- 
Frank Church

===
http://devblog.brahmancreations.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-30 Thread Frank Church
When I get the time via the DateTime function result is adapted for
the timezone, making it an hour ahead now?

Is there a function that returns the UTC time, either as a UnixTime or
TDateTime irregardless of timezone?

-- 
Frank Church

===
http://devblog.brahmancreations.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-30 Thread Reinier Olislagers
On 30-3-2012 16:05, Frank Church wrote:
 When I get the time via the DateTime function result is adapted for
 the timezone, making it an hour ahead now?
 
 Is there a function that returns the UTC time, either as a UnixTime or
 TDateTime irregardless of timezone?
 
Frank,

You could search the fpc and lazarus mailing list; I know there've been
posts regarding this.
IIRC, the conclusion was that doing this is potentially very difficult
to do cross platform, keeping daylight saving changes etc in mind.

There is a separate unit that deals with this, IIRC, the wiki mentions
it somewhere..

Regards,
Reinier

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-30 Thread João Marcelo Vaz
2012/3/30 Reinier Olislagers reinierolislag...@gmail.com

 On 30-3-2012 16:05, Frank Church wrote:
  When I get the time via the DateTime function result is adapted for
  the timezone, making it an hour ahead now?
 
  Is there a function that returns the UTC time, either as a UnixTime or
  TDateTime irregardless of timezone?
 
 Frank,

 You could search the fpc and lazarus mailing list; I know there've been
 posts regarding this.
 IIRC, the conclusion was that doing this is potentially very difficult
 to do cross platform, keeping daylight saving changes etc in mind.

 There is a separate unit that deals with this, IIRC, the wiki mentions
 it somewhere..

 Regards,
 Reinier

 --


PascalTZ does that.

http://wiki.lazarus.freepascal.org/PascalTZ


-- 
João Marcelo
http://blog.caixadepandora.com/
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Is there a function that returns UTC time in FPC or Lazarus?

2012-03-30 Thread waldo kitty

On 3/30/2012 10:05, Frank Church wrote:

When I get the time via the DateTime function result is adapted for
the timezone, making it an hour ahead now?

Is there a function that returns the UTC time, either as a UnixTime or
TDateTime irregardless of timezone?


where are you reading from? the RTC or the OS clock?

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus