[Lazarus] Is there a global timezone-independent time available?

Bo Berglund bo.berglund at gmail.com
Mon May 3 15:59:08 CEST 2021


If I use Now() to retrieve a TDateTime value I get it in whatever timezone
(including DST) the box I run on is set to...
And there is no indication of the timezone used (TDateTime is just a double
after all).

So now I wonder if there is some kind of globally constant time one can read
which can be used in scheduling applications no matter what time zone is used.
For example something like NowUTC() or similar?

I have been struggling with the user part of a remote monitoring system, which
will run on a RaspberryPi under Linux (Debian flavour).

And there are lots of problems when going between the actual remote system and
the config application because of the time zone differences.
It would help a lot if one could use a time that is not messed with and is the
same everywhere...

The important thing here is that two systems located at different places on
Earth should agree on such a time value if it is taken at the same absolute
instant.

And what is the useful resolution of the times?
seconds, miliseconds or what?

-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list