Problems with std.time and local conversion?

fawcett at uwindsor.ca fawcett at uwindsor.ca
Fri Apr 16 06:12:28 PDT 2010


On 10-04-16 09:03 AM, fawcett at uwindsor.ca wrote:
> On 10-04-15 05:10 PM, Jesse Phillips wrote:
>> This bug was reported:
>>
>> http://d.puremagic.com/issues/show_bug.cgi?id=2965
>
> Ah, thank you. I see that importing std.datebase does indeed give
> better results, though still not perfectly so:
>
> #!/usr/bin/dmd -run
>
> import std.datebase;
> import std.stdio;
> import std.date;
>
> void main() {
> // UTC first, then local
> writefln("UTC: %s", toString(getUTCtime()));
> writefln("Local: %s", toString(UTCtoLocalTime(getUTCtime())));
> }
>
> $ TZ=EST5EDT ./timedemo.d
> UTC: Fri Apr 16 08:56:04 GMT-0400 2010
> Local: Fri Apr 16 04:56:04 GMT-0400 2010
>
> The time is right, but the the tzoffset is wrong.

Correction to my observation: the time component is messed up too, it
was 08:56 local time when I ran this, not 04:56.

> That's not quite what #2965 is reporting, so I'll file a new issue.

...which I'll still do.

Best,
Graham



More information about the Digitalmars-d mailing list