iso_parse.mdoc (994B)
- .\" 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][Z] ,
- 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 [Z]
- Is either empty, signifying local time, or the letter
- .Qq Z ,
- signifying UTC.
- .Pp
- This is the only part which disagrees with RFC3339 due to the lack of timezone-offset parsing in
- .St -p1003.1-2008
- .El
- .Pp
- For example:
- .Ql 2003-06-02T13:37:42.713Z