[DUG] Daylight savings

Alister Christie alister at salespartner.co.nz
Thu Apr 3 13:13:17 NZDT 2014


Had a look at copying the source, it's changed a lot so I'm not able to to
just use the unit (Namespaces, OS/X, Android, iOS support, changes to the
way IFDEF work and so on).  Going through the source I couldn't see any
differences in the code itself, but I might have another pass at it.

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



On Thu, Apr 3, 2014 at 11:49 AM, Robo <robo555 at gmail.com> wrote:

> 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
>>
>
>
> _______________________________________________
> 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/cebe86ce/attachment.html 


More information about the Delphi mailing list