Logo

Programming-Idioms

History of Idiom 98 > diff from v3 to v4

Edit summary for version 4 by :
New D implementation by user [piou]

Version 3

2015-10-29, 14:05:17

Version 4

2015-11-04, 00:06:59

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Imports
import std.datetime, std.stdio;
Code
auto d = SysTime(unixTimeToStdTime(ts), UTC());
Doc URL
http://dlang.org/phobos/std_datetime.html