How do I convert an ISO 8601 datetime into a unix timestamp - at compile-time?

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Aug 28 01:55:40 UTC 2020


On Friday, 28 August 2020 at 01:54:02 UTC, Andrej Mitrovic wrote:
> -----
> import std.datetime;
>
> void main ()
> {
>     static time =
>         
> SysTime(DateTime.fromISOString("20220101T000000")).toUnixTime;
> }
> -----

I think I'm supposed to use MonoTime here, right?



More information about the Digitalmars-d-learn mailing list