Open rsaarelm opened 8 months ago
Signature would be something like (ZonedTime | :else) strptime(string timestamp, string format)
(ZonedTime | :else) strptime(string timestamp, string format)
Usage: "2024-03-15T12:15:01+0200".strptime("%Y-%m-%dT%H:%M:%S%z"). The timezone info carrying time type is needed too...
"2024-03-15T12:15:01+0200".strptime("%Y-%m-%dT%H:%M:%S%z")
Also do strftime that goes the other way, internal time value to formatted string. string strftime(ZonedTime t, string format).
strftime
string strftime(ZonedTime t, string format)
Like SysTime in D, std.time.Time should have a timezone field and support all the parser stuff.
Signature would be something like
(ZonedTime | :else) strptime(string timestamp, string format)
Usage:
"2024-03-15T12:15:01+0200".strptime("%Y-%m-%dT%H:%M:%S%z")
. The timezone info carrying time type is needed too...Also do
strftime
that goes the other way, internal time value to formatted string.string strftime(ZonedTime t, string format)
.