parse

Parse the given datetime string with the given format string.

This tries rather hard to produce a reasonable result. If the format string doesn't describe an unambiguous point time, the result will be a date that satisfies the inputs and should generally be the earliest such date. However, that is not guaranteed.

For instance:

SysTime time = parse("%d", "21");
writeln(time);  // 0000-01-21T00:00:00.000000Z
  1. SysTime parse(string data, Format fmt, immutable(TimeZone) defaultTimeZone, bool allowTrailingData)
    @safe
    SysTime
    parse
    (
    string data
    ,
    const Format fmt
    ,
    immutable(TimeZone) defaultTimeZone = null
    ,
    bool allowTrailingData = false
    )
  2. SysTime parse(string data, string formatString, immutable(TimeZone) defaultTimeZone, bool allowTrailingData)

Meta