[fpc-devel] NowUTC in FPC

Denis Kozlov dezlov at gmail.com
Wed Jul 20 14:49:11 CEST 2016


On 20 July 2016 at 13:31, Marco van de Voort <marcov at stack.nl> wrote:

> In our previous episode, Denis Kozlov said:
> > Is it possible to move NowUTC from LazUTF8SysUtils.NowUTC to FPC, e.g.
> > DateUtils?
> >
> > LocalTimeToUniversal(Now) is inefficient and suffers from a race
> condition,
> > but can still be used as a fallback implementation.
>
> Isn't that horribly misnamed? It seems to get system time without
> additional
> timezone corrections by FPC, but there is no guarantee that that is UTC?
>

Do you mean "NowUTC" is misnamed? Sure, just as many other things, but
consistency is gold-ish ;)

I'm not sure why you say there is no guarantee, because in example of
Windows implementation GetSystemTime API is explicitly expressed in UTC
according to MSDN.

Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160720/5e62f89c/attachment.html>


More information about the fpc-devel mailing list