#1 2016-03-30 14:25:16

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

How SynCommons.TSynTimeZone save my production server

I was once again convinced that the use of Delphi RTL on the server side is a bad idea.
28.03.2016 at 00:30 UTC my server stopped to handle a static files.
This is because inside my code I add a "Last-Modified" header using TTimeZone.Local.ToUniversalTime.
But on the XE2 even with ForceDaylight=true this method raise ELocalTimeInvalid on the Daylight saving time sad

I rewrite all my time-related code using TSynTimeZone and now everything is OK. Thanks to you, @AB for a great framework!!!

P.S.
previous RTL "feature" was in TPersistent  (huge lock inside Destroy), so I replace all TPersistent -> TSynPersistent

Offline

#2 2016-03-30 16:55:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,666
Website

Re: How SynCommons.TSynTimeZone save my production server

... and TSynTimeZone works under Linux, using the time bias information retrieved from a Windows System, and linked as a resource...

Thanks for the feedback!

Offline

#3 2016-03-31 10:18:26

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: How SynCommons.TSynTimeZone save my production server

After consultation with my colleague I discover Windows timeZone information is incomplete (and incorrect on some Windows versions). MacOS timeZones is broken starting from first versions of MacOS. The only correct solution is to use Tz_database. So this is a subject for possible modification of TSynTimeZone. On the WiKi page already exist Delphi & FPC implementations of Tz_database

Last edited by mpv (2016-03-31 10:20:57)

Offline

Board footer

Powered by FluxBB