[DUG] Daylight savings
Rodney
rchan at compuspec.com
Thu Apr 3 13:39:36 NZDT 2014
Probably can have a look at these links:
http://stackoverflow.com/questions/3448983/delphi-equivalent-to-c-sharp-date
time-isdaylightsavingtime-method-needed
http://code.google.com/p/delphi-tzdb/
Rodney
-----Original Message-----
From: delphi-bounces at listserver.123.net.nz
[mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of
delphi-request at listserver.123.net.nz
Sent: Thursday, 3 April 2014 12:00 p.m.
To: delphi at listserver.123.net.nz
Subject: Delphi Digest, Vol 126, Issue 5
Send Delphi mailing list submissions to
delphi at listserver.123.net.nz
To subscribe or unsubscribe via the World Wide Web, visit
http://listserver.123.net.nz/mailman/listinfo/delphi
or, via email, send a message with subject or body 'help' to
delphi-request at listserver.123.net.nz
You can reach the person managing the list at
delphi-owner at listserver.123.net.nz
When replying, please edit your Subject line so it is more specific than
"Re: Contents of Delphi digest..."
Today's Topics:
1. Re: Daylight savings (Robo)
----------------------------------------------------------------------
Message: 1
Date: Thu, 3 Apr 2014 00:49:01 +0200
From: Robo <robo555 at gmail.com>
Subject: Re: [DUG] Daylight savings
To: NZ Borland Developers Group - Delphi List
<delphi at listserver.123.net.nz>
Message-ID:
<CAJLpVUM1Kd98B0xTyTRF-R8atWtqK2usPaypKX6xprkSh=Pqyg at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
NZ changed the day light saving week a few years ago, hence the incorrect
calculation on older version of Delphi. Easiest way would probably be to
copy XE5's source code.
Robo
On Thu, Apr 3, 2014 at 12:30 AM, Alister Christie <
alister at salespartner.co.nz> wrote:
> I've noticed in Delphi XE that TTimeZone.Local.ToUniversalTime is a
> week out on daylight savings, it works correctly in XE5 however (and
> probably earlier versions).
>
> program Project6;
>
> {$APPTYPE CONSOLE}
>
> uses
> SysUtils,
> DateUtils;
>
> begin
> Writeln(DateTimeToStr(TTimeZone.Local.ToUniversalTime(StrToDateTime(
> '5/4/2014 2pm'))));
> Writeln(DateTimeToStr(TTimeZone.Local.ToUniversalTime(StrToDateTime(
> '12/4/2014 2pm'))));
> Readln;
> end.
>
>
> Outputs
>
> 5/04/2014 1:00:00 a.m.
> 6/04/2014 1:00:00 a.m.
>
> in XE (incorrectly) and
>
> 5/04/2014 1:00:00 a.m.
> 6/04/2014 2:00:00 a.m.
>
> in XE5 (correctly). XE works correctly from the 13th onwards - so
> it's just a problem for a week.
>
> Does anyone have some code that does conversions to UTC correctly for
> Delphi XE?
>
> Alister Christie
> Computers for People
> Ph: 04 471 1849 Fax: 04 471 1266http://www.salespartner.co.nz Follow
> us on Twitter http://twitter.com/salespartner PO Box 13085
> Johnsonville Wellington
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://listserver.123.net.nz/pipermail/delphi/attachments/20140403/881f707a/
attachment-0001.html
------------------------------
_______________________________________________
Delphi mailing list
Delphi at listserver.123.net.nz
http://listserver.123.net.nz/mailman/listinfo/delphi
End of Delphi Digest, Vol 126, Issue 5
**************************************
More information about the Delphi
mailing list