www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12828] New: Fix SimpleTimeZone.utcOffset so that it has the


          Issue ID: 12828
           Summary: Fix SimpleTimeZone.utcOffset so that it has the
                    correct return type
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: jmdavisProg gmx.com

It's the policy of time-related code in druntime and Phobos to never use naked
integral values for time - in particular, any duration of time should use
core.time.Duration rather than an integer for seconds or microseconds or

I got this right almost everywhere in core.time and std.datetime, but for some
reason I screwed up when writing SimpleTimeZone and didn't catch it before it
got merged into Phobos. SimpleTimeZone.utcOffset is supposed to return the
offset from UTC for that time zone, and should return a Duration.
Unfortunately, it returns an int which represents minutes (something which is
done with the POSIX functions in glibc and whatnot). So, utcOffset needs to be
changed to be a Duration.

May 31 2014