logo

utils-std

Collection of commonly available Unix tools

date.1 (1395B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017-2022 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .Dd 2023-06-03
  5. .Dt DATE 1
  6. .Os
  7. .Sh NAME
  8. .Nm date
  9. .Nd display date and time
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl u
  13. .Op Fl d Ar datetime
  14. .Op Cm + Ns Ar format
  15. .Sh DESCRIPTION
  16. When
  17. .Nm
  18. is invoked without arguments it displays the current datetime
  19. Otherwise, depending on the options specified, will print the datetime in a user-defined way.
  20. .Bl -tag -width Ds
  21. .It Fl d Ar datetime
  22. .Ar datetime
  23. can contain the Unix timestamp (number of seconds before and after 1970-01-01T00:00:00Z) prefixed by an @ (at) symbol,
  24. or a date-time formatted as
  25. .Ql YYYY-MM-DDThh:mm:SS[frac][Z] ,
  26. see
  27. .Xr touch 1
  28. for more details on the format.
  29. .It Fl u
  30. Use UTC (coordinated universal time) instead of the local time.
  31. .El
  32. .Pp
  33. The plus operand
  34. .Pq Sq +
  35. specifies in which format the datetime should be displayed, the format string is specified in the
  36. .Xr strftime 3
  37. manual page.
  38. .Sh ENVIRONMENT
  39. Look at the manual page of
  40. .Xr strftime 3
  41. for the environment variables, typical ones are
  42. .Ev TZ ,
  43. .Ev LC_TIME and
  44. .Ev LC_ALL but that depends on your system.
  45. .Sh EXIT STATUS
  46. .Ex -std
  47. .Sh SEE ALSO
  48. .Xr strftime 3
  49. .Sh STANDARDS
  50. .Nm
  51. is mostly compliant with the
  52. .St -p1003.1-2008
  53. specification.
  54. .Sh AUTHORS
  55. .An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me