@metreeca/http - v0.1.1
    Preparing search index...

    Function parseInstant

    • Parses a date field value.

      Note

      Every date format HTTP defines is read, the preferred one and the two obsolete ones alike, and no other: a date in some other notation, an ISO 8601 one included, is reported as missing rather than guessed at, leaving the consumer to decide what to make of it. So is a date naming no real day, a thirtieth of February among them.

      Where a format states a two-digit year, it is read as the most recent past year ending in those digits rather than as a date more than fifty years ahead.

      A leap second, which the grammar admits, rolls over into the following minute rather than being reported as missing.

      Parameters

      • value: Nullable<string>

        The field value to be parsed, possibly missing

      Returns number | undefined

      The instant value states, in milliseconds since the epoch; undefined if value is missing or doesn't state a date in one of the three formats HTTP defines