iso_parse.mdoc (1010B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .\"
- .\" Example:
- .\" .Fl d Ar datetime
- .\" .so lib/iso_parse.mdoc
- .\"
- Should be formatted either with a leading @ (at) symbol followed by
- the Unix timestamp (number of seconds before and after 1970-01-01 00:00:00Z),
- for example
- .Ql @1698791420
- corresponds to 2023-10-31 23:30:20 UTC
- .Pp
- Or as
- .Ql YYYY-MM-DDThh:mm:SS[frac][tz] ,
- where:
- .Bl -tag -width Ds
- .It Ql YYYY-MM-DD
- Corresponds to %Y-%m-%d of
- .Xr strptime 3 .
- .It Ql T
- Is either
- .Ql T
- or a space.
- .It Ql [frac]
- Is either empty, or fractional seconds starting with either a comma
- .Pq \&,
- or a period
- .Pq \&. .
- .It Ql [tz]
- When empty it corresponds to local time.
- Otherwise it can be an UTC offset in the format
- .Ql [+-]HH:?MM
- or the letter
- .Qq Z ,
- signifying UTC.
- .El
- .Pp
- Some examples:
- .Bl -bullet -compact
- .It
- .Ql 2003-06-02T13:37:42.713Z
- .It
- .Ql 1971-01-02T03:04:05.678+0900
- .El