[patch] UTC time in FPC
Original Reporter info from Mantis: dezlov
-
Reporter name: Denis Kozlov
Original Reporter info from Mantis: dezlov
- Reporter name: Denis Kozlov
Description:
This patch adds a UniversalTime function which returns current TDateTime in UTC.
Currently, it's possible to use LocalTimeToUniversal(Now), but it is inefficient and suffers from a race condition.
Implementation of UniversalTime is based on LazUTF8SysUtils.NowUTC, but is significantly simplified and has an improved fallback implementation.
Additional information:
As discussed in the mailing list:
http://lists.freepascal.org/fpc-devel/2016-July/037226.html
The name UniversalTime seems better than NowUTC, and it fits nicely in DateUtils unit, but feel free to change it as you see fit.
Mantis conversion info:
- Mantis ID: 30394
- Version: 3.1.1
- Monitored by: » dezlov (Denis Kozlov)