[Issue 14792] Add function to convert from unix time to SysTime

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jul 19 07:15:22 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14792

--- Comment #1 from github-bugzilla at puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/4899aa85d22114cd56be87ec8cb243d2a13f5b1e
Implement issue# 14792: Add SysTime.fromUnixTime.

We've had the ability to convert from unix time to SysTime, but it has
been more unwieldy than it should be. This adds fromUnixTime to go with
toUnixTime.

In addition, these changes solve the problem where you sometimes need a
value for unix time that doesn't fit in time_t (e.g. a 64-bit value on a
32-bit system), or you're dealing with a 64-bit time_t on a 32-bit
system (which Windows sometimes does). So, toUnixTime and
stdTimeToUnixTime now take an optional template argument which indicates
how many bits the result should be (defaulting to match the size of
time_t), and fromUnixTime and unixTimeToStdTime now take long rather
than time_t so that they can accept 64-bit values on 32-bit systems.

https://github.com/D-Programming-Language/phobos/commit/a9cd76147fbb87e0326c3e302119a7eb0e531d6d
Merge pull request #3481 from jmdavis/issue14792

Implement issue# 14792: Add SysTime.fromUnixTime.

--


More information about the Digitalmars-d-bugs mailing list