April 15, 2019
https://issues.dlang.org/show_bug.cgi?id=19808

          Issue ID: 19808
           Summary: SysTime gives different results at compile vs. run
                    time execution
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody@puremagic.com
          Reporter: david.eckardt@frequenz.io

void f()
{
  import std.datetime.systime: SysTime;
  import std.datetime.timezone: UTC;

  static immutable ctfe = SysTime.fromUnixTime(0, UTC());
  auto rtfe = SysTime.fromUnixTime(0, UTC());
  assert(ctfe == rtfe); // Succeeds
  string a = ctfe.toISOExtString(); // a == "1970-01-01T00:00:00+00:00"
  string b = rtfe.toISOExtString(); // b == "1970-01-01T00:00:00Z"
}

This behaviour is mentioned in https://issues.dlang.org/show_bug.cgi?id=12507#c12

> … and thus will print out its timezone as +00:00 instead of z, which is perfectly legitimate per the spec.

Although both strings logically contain the same time information and comply with the ISO standard, two SysTime instances comparing equal yet yielding different strings depending on previous compile- vs. run-time execution is very surprising.

--