Function std.datetime.SysTime.toISOString
Converts this SysTime
to a string with the format
YYYYMMDDTHHMMSS.FFFFFFFTZ (where F is fractional seconds and TZ is time
zone).
Note that the number of digits in the fractional seconds varies with the number of fractional seconds. It's a maximum of 7 (which would be hnsecs), but only has as many as are necessary to hold the correct value (so no trailing zeroes), and if there are no fractional seconds, then there is no decimal point.
If this SysTime
's time zone is LocalTime
, then TZ is empty.
If its time zone is
, then it is "Z". Otherwise, it is the
offset from UTC
UTC
(e.g. +1:00 or -7:00). Note that the offset from UTC
is not enough to uniquely identify the time zone.
Time zone offsets will be in the form +HH:MM or -HH:MM.
Prototype
string toISOString() nothrow @safe const;
Example
assert(SysTime(DateTime(2010, 7, 4, 7, 6, 12)).toISOString() == "20100704T070612"); assert(SysTime(DateTime(1998, 12, 25, 2, 15, 0), msecs(24)).toISOString() == "19981225T021500.024"); assert(SysTime(DateTime(0, 1, 5, 23, 9, 59)).toISOString() == "00000105T230959"); assert(SysTime(DateTime(-4, 1, 5, 0, 0, 2), hnsecs(520_920)).toISOString() == "-00040105T000002.052092");
Authors
Jonathan M Davis and Kato Shoichi