Summary: nonzero timezone offset in UTC timestamp; wrong local
           Product: D
           Version: future
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Graham Fawcett <> 2010-04-16 
06:16:57 PDT ---
In DMD Version 2.043, the following code should print a timestamp both
in UTC and local time. The local tzoffset is correct, but the UTC
tzoffset should not be nonzero. Furthermore, what claims to be the UTC
time is actually the localtime, and the so-called localtime is just
wrong. The code imports std.datebase to hack around the initialization
issue reported in #2965.

    #!/usr/bin/dmd -run

    import std.datebase;
    import std.stdio;

    void main() {
        writefln("UTC:   %s", toString(getUTCtime()));
        writefln("Local: %s", toString(UTCtoLocalTime(getUTCtime())));

$ TZ=EST5EDT date
Fri Apr 16 09:14:35 EDT 2010

$ TZ=EST5EDT ./timedemo.d
UTC:   Fri Apr 16 09:14:37 GMT-0400 2010
Local: Fri Apr 16 05:14:37 GMT-0400 2010

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to