| Functionality | Symbols |
|---|---|
| Points in Time | Clock Date TimeOfDay DateTime SysTime |
| Timezones | TimeZone UTC LocalTime PosixTimeZone WindowsTimeZone SimpleTimeZone |
| Intervals and Ranges of Time | Interval PosInfInterval NegInfInterval |
| Durations of Time | Duration weeks days hours minutes seconds msecs usecs hnsecs nsecs |
| Time Measurement and Benchmarking | MonoTime StopWatch benchmark |
Sourcestd/datetime/package.d
import std.datetime.systime : SysTime, Clock;SysTime currentTime = Clock.currTime();
import std.datetime.date : DateTime;auto dt = DateTime(2018, 1, 1, 12, 30, 10);writeln(dt.toISOString());// "20180101T123010"writeln(dt.toISOExtString());// "2018-01-01T12:30:10"
import std.datetime.systime : SysTime;import std.datetime.timezone : UTC;import core.time : days;auto st = SysTime(DateTime(2018, 1, 1, 12, 30, 10), UTC());writeln(st.toISOExtString());// "2018-01-01T12:30:10Z"st += 2.days;writeln(st.toISOExtString());// "2018-01-03T12:30:10Z"