[fpc-devel] NowUTC in FPC

Denis Kozlov dezlov at gmail.com
Mon Aug 1 03:21:59 CEST 2016

On 30/07/2016 17:45, Michael Van Canneyt wrote:
> I don't see why you cannot perform simple additions in sysutils.
But that would create duplicated code of LocalTimeToUniversal, 
UnixToDateTime, IncMilliSecond functions in SysUtils and DateUtils.

> As far as I can see, these perform almost the same function as 
> EpochToLocal in
> sysutils/unix. 
EpochToLocal is equivalent to UnixToDateTime, except the later is more 
efficient and better named. Also, I found at least 4 copies of 
EpochToLocal in RTL for some reason, one of which suggests to use 
UnixToDateTime instead ;)

Assuming that UniversalTime function must reside in SysUtils, I see 
these options:

* Option A: Duplicate necessary functions from DateUtils to SysUtils.
* Option B: Move necessary functions from DateUtils to SysUtils.
* Option C: Include DateUtils in RTL, so that we cant use its functions 
in SysUtils.

Option C seems to be the cleanest. Am I wrong to think that?


More information about the fpc-devel mailing list