[fpc-devel] NowUTC in FPC

Denis Kozlov dezlov at gmail.com
Wed Jul 20 16:49:10 CEST 2016


On 20 July 2016 at 15:33, Henry Vermaak <henry.vermaak at gmail.com> wrote:

> On Wed, Jul 20, 2016 at 03:26:56PM +0100, Denis Kozlov wrote:
> > Don't mind another poorly chosen name "EpochToLocal", which in reality is
> > more like "UnixToDateTime".
> >
> > Is there an issue I'm just not seeing?
>
> I thought the same.  Maybe the implementation predates UnixToDateTime()?
> Worth a bug report, I think.
>
>
Well, Unix implementation of NowUTC can be replaced with a tidy:

function NowUTC: TDateTime;
var
  tp: timeval;
begin
  fpgettimeofday(@tp,nil);
  Result := UnixToDateTime(tp.tv_sec);
end;

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


More information about the fpc-devel mailing list