logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

iso_parse.mdoc (1010B)


  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][tz] ,
  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 [tz]
  32. When empty it corresponds to local time.
  33. Otherwise it can be an UTC offset in the format
  34. .Ql [+-]HH:?MM
  35. or the letter
  36. .Qq Z ,
  37. signifying UTC.
  38. .El
  39. .Pp
  40. Some examples:
  41. .Bl -bullet -compact
  42. .It
  43. .Ql 2003-06-02T13:37:42.713Z
  44. .It
  45. .Ql 1971-01-02T03:04:05.678+0900
  46. .El