logo

utils-std

Collection of commonly available Unix tools

iso_parse.mdoc (994B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .\"
  5. .\" Example:
  6. .\" .Fl d Ar datetime
  7. .\" .so lib/iso_parse.mdoc
  8. .\"
  9. Should be formatted either with a leading @ (at) symbol followed by
  10. the Unix timestamp (number of seconds before and after 1970-01-01 00:00:00Z),
  11. for example
  12. .Ql @1698791420
  13. corresponds to 2023-10-31 23:30:20 UTC
  14. .Pp
  15. Or as
  16. .Ql YYYY-MM-DDThh:mm:SS[frac][Z] ,
  17. where:
  18. .Bl -tag -width Ds
  19. .It Ql YYYY-MM-DD
  20. Corresponds to %Y-%m-%d of
  21. .Xr strptime 3 .
  22. .It Ql T
  23. Is either
  24. .Ql T
  25. or a space.
  26. .It Ql [frac]
  27. Is either empty, or fractional seconds starting with either a comma
  28. .Pq \&,
  29. or a period
  30. .Pq \&. .
  31. .It Ql [Z]
  32. Is either empty, signifying local time, or the letter
  33. .Qq Z ,
  34. signifying UTC.
  35. .Pp
  36. This is the only part which disagrees with RFC3339 due to the lack of timezone-offset parsing in
  37. .St -p1003.1-2008
  38. .El
  39. .Pp
  40. For example:
  41. .Ql 2003-06-02T13:37:42.713Z