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?

Mailing lists / fpc-pascal / 2012-03
6 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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
2012/3/30 Reinier Olislagers
PascalTZ does that.
http://wiki.lazarus.freepascal.org/PascalTZ
You could search the fpc and lazarus mailing list; I know there've been posts regarding…
agreed... even in the TP/BP6/7 days... it depends on the setting of the local clock as to whether you to daylight saving display or not... i know of many that operate on UTC and do not do local time when viewing... it can be done but it is going to be a "trick" ;)
2012/3/30 Reinier Olislagers PascalTZ does that.…
Thanks, João, that's the one I meant!
Reinier
When I get the time via the DateTime function result is adapted for the timezone, making…
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.