www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4096] New: nonzero timezone offset in UTC timestamp; wrong local time.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4096

           Summary: nonzero timezone offset in UTC timestamp; wrong local
                    time.
           Product: D
           Version: future
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: graham.fawcett gmail.com



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




    import std.datebase;
    import std.stdio;
    import std.date;

    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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 16 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4096


Lars T. Kyllingstad <bugzilla kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla kyllingen.net
         Resolution|                            |WONTFIX



01:29:06 PST ---
std.date has been superseded by std.datetime.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 03 2011