toString

Converts this Date to a string with the format YYYY-MM-DD. If writer is set, the resulting string will be written directly to it.

  1. string toISOExtString()
  2. alias toString = toISOExtString
    alias toString = toISOExtString
  3. void toISOExtString(W w)

Return Value

A string when not using an output range; void otherwise.

Examples

assert(Date.init.toISOExtString == "null");
assert(Date(2010, 7, 4).toISOExtString == "2010-07-04");
assert(Date(1998, 12, 25).toISOExtString == "1998-12-25");
assert(Date(0, 1, 5).toISOExtString == "0000-01-05");
assert(Date(-4, 1, 5).toISOExtString == "-0004-01-05");

Meta