Date.toISOString

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

  1. string toISOString()
  2. void toISOString(W writer)
    struct Date
    const
    void
    toISOString
    (
    W
    )
    (
    ref W writer
    )
    if (
    isOutputRange!(W, char)
    )

Parameters

writer W

A char accepting output range

Return Value

Type: void

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

Examples

assert(Date(2010, 7, 4).toISOString() == "20100704");
assert(Date(1998, 12, 25).toISOString() == "19981225");
assert(Date(0, 1, 5).toISOString() == "00000105");
assert(Date(-4, 1, 5).toISOString() == "-00040105");

Meta