logo

utils-std

Collection of commonly available Unix tools

date.1.in (1707B)


  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. .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 uR
  13. .Op Fl d Ar datetime
  14. .Op Cm + Ns Ar format
  15. .Nm
  16. .Op Fl uR
  17. .Fl f Ar now_format
  18. .Ar now
  19. .Op Cm + Ns Ar format
  20. .Sh DESCRIPTION
  21. When
  22. .Nm
  23. is invoked without arguments it displays the current datetime
  24. Otherwise, depending on the options specified, will print the datetime in a user-defined way.
  25. .Sh OPTIONS
  26. .Bl -tag -width Ds
  27. .It Fl d Ar datetime
  28. Use
  29. .Ar datetime
  30. instead of current datetime.
  31. include(lib/iso_parse.mdoc)
  32. .It Fl f Ar now_format
  33. Use
  34. .Ar now_format
  35. as the
  36. .Xr strptime 3
  37. format string for
  38. .Ar now ,
  39. which will be used instead of the current datetime.
  40. .It Fl u
  41. Use UTC (coordinated universal time) instead of the local time.
  42. .It Fl R
  43. Set the default value of
  44. .Ar format
  45. to match RFC5322 (Internet Message Format).
  46. .It Cm + Ns Ar format
  47. Set the displayed datetime in
  48. .Xr strftime 3
  49. format.
  50. Otherwise defaults to
  51. .Ql %c
  52. .El
  53. .Sh ENVIRONMENT
  54. Look at the manual page of
  55. .Xr strftime 3
  56. for the environment variables, typical ones are
  57. .Ev TZ ,
  58. .Ev LC_TIME
  59. and
  60. .Ev LC_ALL
  61. but this depends on your system.
  62. .Sh EXIT STATUS
  63. .Ex -std
  64. .Sh SEE ALSO
  65. .Xr strftime 3
  66. .Sh STANDARDS
  67. Except for the lack of setting the system date and time,
  68. .Nm
  69. is compliant with the
  70. .St -p1003.1-2008
  71. specification.
  72. .Pp
  73. The
  74. .Fl d
  75. and
  76. .Fl R
  77. options are present for compatibility with other modern systems such as
  78. NetBSD, BusyBox, and GNU coreutils.
  79. The
  80. .Fl f
  81. option is inspired by NetBSD.
  82. .Sh AUTHORS
  83. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me