Re: [fpc-devel] NowUTC in FPC

2016-08-01 Thread Michael Van Canneyt
On Mon, 1 Aug 2016, Denis Kozlov wrote: On 01/08/2016 07:59, Michael Van Canneyt wrote: But that would create duplicated code of LocalTimeToUniversal, UnixToDateTime, IncMilliSecond functions in SysUtils and DateUtils. So what ? It is essentially A+B*C or some variant of that. I try to av

Re: [fpc-devel] NowUTC in FPC

2016-08-01 Thread Denis Kozlov
On 01/08/2016 07:59, Michael Van Canneyt wrote: But that would create duplicated code of LocalTimeToUniversal, UnixToDateTime, IncMilliSecond functions in SysUtils and DateUtils. So what ? It is essentially A+B*C or some variant of that. I try to avoid code duplication, which unnecessarily in

Re: [fpc-devel] NowUTC in FPC

2016-07-31 Thread Michael Van Canneyt
On Mon, 1 Aug 2016, Denis Kozlov wrote: 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. So wha

Re: [fpc-devel] NowUTC in FPC

2016-07-31 Thread Denis Kozlov
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

Re: [fpc-devel] NowUTC in FPC

2016-07-30 Thread Michael Van Canneyt
On Sat, 30 Jul 2016, Denis Kozlov wrote: On 30/07/2016 11:10, Michael Van Canneyt wrote: I had a look at it. Please modify the patch first, see comments in bugreport. The reason why I put UniversalTime (a.k.a. NowUTC) function in DateUtils is because of the dependency on LocalTimeToUnivers

Re: [fpc-devel] NowUTC in FPC

2016-07-30 Thread Denis Kozlov
On 30/07/2016 11:10, Michael Van Canneyt wrote: I had a look at it. Please modify the patch first, see comments in bugreport. The reason why I put UniversalTime (a.k.a. NowUTC) function in DateUtils is because of the dependency on LocalTimeToUniversal, UnixToDateTime, IncMilliSecond functions

Re: [fpc-devel] NowUTC in FPC

2016-07-30 Thread Michael Van Canneyt
On Sat, 30 Jul 2016, Denis Kozlov wrote: Can somebody take a look and apply the patch please? I had a look at it. Please modify the patch first, see comments in bugreport. Michael. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http:/

Re: [fpc-devel] NowUTC in FPC

2016-07-30 Thread Denis Kozlov
Can somebody take a look and apply the patch please? Thanks On 21/07/2016 09:37, Denis Kozlov wrote: I've uploaded a patch to mantis: http://bugs.freepascal.org/view.php?id=30394 Denis ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http

Re: [fpc-devel] NowUTC in FPC

2016-07-21 Thread Denis Kozlov
On 21/07/2016 10:04, Ondrej Pokorny wrote: Why does your client ignore mailing list threads? (Or why does my Thunderbird email client ignore threads on messages sent from you?) It's replying through Gmail web interface seems to screw it up. Can't use it for mailing lists then. Bummer. P.S. T

Re: [fpc-devel] NowUTC in FPC

2016-07-21 Thread Ondrej Pokorny
On 21.07.2016 11:19, Denis Kozlov wrote: On 21 July 2016 at 10:04, Ondrej Pokorny > wrote: Why does your client ignore mailing list threads? (Or why does my Thunderbird email client ignore threads on messages sent from you?) I use latest Thunderbird too and G

Re: [fpc-devel] NowUTC in FPC

2016-07-21 Thread Henry Vermaak
On Thu, Jul 21, 2016 at 10:24:02AM +0100, Henry Vermaak wrote: > On Thu, Jul 21, 2016 at 11:04:15AM +0200, Ondrej Pokorny wrote: > > On 21.07.2016 10:37, Denis Kozlov wrote: > > >I've uploaded a patch to mantis: > > >http://bugs.freepascal.org/view.php?id=30394 > > > > Why does your client ignore

Re: [fpc-devel] NowUTC in FPC

2016-07-21 Thread Henry Vermaak
On Thu, Jul 21, 2016 at 11:04:15AM +0200, Ondrej Pokorny wrote: > On 21.07.2016 10:37, Denis Kozlov wrote: > >I've uploaded a patch to mantis: > >http://bugs.freepascal.org/view.php?id=30394 > > Why does your client ignore mailing list threads? (Or why does my > Thunderbird email client ignore thr

Re: [fpc-devel] NowUTC in FPC

2016-07-21 Thread Denis Kozlov
On 21 July 2016 at 10:04, Ondrej Pokorny wrote: > > Why does your client ignore mailing list threads? (Or why does my > Thunderbird email client ignore threads on messages sent from you?) > I use latest Thunderbird too and Gmail web interface sometimes, but haven't seen this behavior with my thr

Re: [fpc-devel] NowUTC in FPC

2016-07-21 Thread Ondrej Pokorny
On 21.07.2016 10:37, Denis Kozlov wrote: I've uploaded a patch to mantis: http://bugs.freepascal.org/view.php?id=30394 Why does your client ignore mailing list threads? (Or why does my Thunderbird email client ignore threads on messages sent from you?) Ondrej __

Re: [fpc-devel] NowUTC in FPC

2016-07-21 Thread Denis Kozlov
I've uploaded a patch to mantis: http://bugs.freepascal.org/view.php?id=30394 Denis ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Denis Kozlov
On 20 July 2016 at 15:52, Denis Kozlov wrote: > > So, below is a tidy cross-platform implementation of NowUTC: > Oops, forgot the milliseconds, here it is: function NowUTC: TDateTime; {$ifdef WINDOWS} var SystemTime: TSystemTime; begin Windows.GetSystemTime(SystemTime); Result := SystemTi

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Denis Kozlov
On 20 July 2016 at 10:08, Denis Kozlov wrote: > 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. > So, below is a tidy cross-pl

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Denis Kozlov
On 20 July 2016 at 15:33, Henry Vermaak 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. Mayb

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Henry Vermaak
On Wed, Jul 20, 2016 at 03:26:56PM +0100, Denis Kozlov wrote: > On 20 July 2016 at 14:47, Marco van de Voort wrote: > > > In our previous episode, Denis Kozlov said: > > > I'm not sure why you say there is no guarantee, because in example of > > > Windows implementation GetSystemTime API is expli

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Denis Kozlov
On 20 July 2016 at 14:47, Marco van de Voort wrote: > In our previous episode, Denis Kozlov said: > > 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. > > I was looking at the U

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Marco van de Voort
In our previous episode, Denis Kozlov said: > > 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, b

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Denis Kozlov
On 20 July 2016 at 13:31, Marco van de Voort 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 us

Re: [fpc-devel] NowUTC in FPC

2016-07-20 Thread Marco van de Voort
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

[fpc-devel] NowUTC in FPC

2016-07-20 Thread Denis Kozlov
Hello, 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. Denis ___ fpc-devel maillist - fp