[phobos] [D-Programming-Language/phobos] 4899aa: Implement issue# 14792: Add SysTime.fromUnixTime.

GitHub via phobos phobos at puremagic.com
Sun Jul 19 07:15:20 PDT 2015


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/phobos
  Commit: 4899aa85d22114cd56be87ec8cb243d2a13f5b1e
      https://github.com/D-Programming-Language/phobos/commit/4899aa85d22114cd56be87ec8cb243d2a13f5b1e
  Author: Jonathan M Davis <jmdavisProg at gmx.com>
  Date:   2015-07-13 (Mon, 13 Jul 2015)

  Changed paths:
    M std/datetime.d

  Log Message:
  -----------
  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.


  Commit: a9cd76147fbb87e0326c3e302119a7eb0e531d6d
      https://github.com/D-Programming-Language/phobos/commit/a9cd76147fbb87e0326c3e302119a7eb0e531d6d
  Author: Dmitry Olshansky <dmitry.olsh at gmail.com>
  Date:   2015-07-19 (Sun, 19 Jul 2015)

  Changed paths:
    M std/datetime.d

  Log Message:
  -----------
  Merge pull request #3481 from jmdavis/issue14792

Implement issue# 14792: Add SysTime.fromUnixTime.


Compare: https://github.com/D-Programming-Language/phobos/compare/764312eea6e1...a9cd76147fbb


More information about the phobos mailing list