logo

cross-unix-documentation

documentation of similarities and (noteworthy) differencies between Unix systems git clone https://hacktivis.me/git/cross-unix-documentation.git

date.1x (2603B)


  1. .\" This file is part of Cross Unix Documentation
  2. .\" Copyright © 2019-2020 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  3. .\" SPDX-License-Identifier: CC-BY-4.0
  4. .Dd 2019-03-03
  5. .Dt DATE 1x
  6. .Os
  7. .Sh PROLOG
  8. This manual page is part of
  9. .Lk https://hacktivis.me/git/cross-unix-documentation "Cross-Unix Documentation"
  10. which is an attempt to provide documentation of similarities and (noteworthy) differencies between Unix-like systems.
  11. To be used as an addition to the POSIX standard.
  12. .Sh NAME
  13. .Nm date
  14. .Nd display or set the date and time
  15. .Sh SYNOPSIS
  16. .Nm
  17. .Op Fl u
  18. .Op Fl d Ar date
  19. .Op Ar +format
  20. .Nm
  21. .Op Fl u
  22. setdate
  23. .Sh DESCRIPTION
  24. .Bl -tag -width Ds
  25. .It Fl u
  26. Use UTC
  27. .It Fl d Ar date
  28. Use
  29. .Ar date
  30. instead of current datetime (aka now). Absent for POSIX, present for
  31. .Nx ,
  32. .Fx ,
  33. .Ox ,
  34. GNU coreutils,
  35. BusyBox.
  36. .El
  37. .Ss +format
  38. It is mostly similar to
  39. .Xr strftime 3
  40. but it actually presents some differencies, for example POSIX doesn't put the usual (
  41. .Nx ,
  42. .Fx ,
  43. .Ox ,
  44. GNU coreutils, BusyBox) %s for seconds since 1970-01-01 00:00:00 UTC (aka Unix Epoch) into
  45. .Xr date 1
  46. but it is present into
  47. .Xr strftime 3 .
  48. Not sure if this is a bug into the specification or not.
  49. .Pp
  50. .Nx ,
  51. .Fx ,
  52. .Ox
  53. just gives
  54. .Ar format
  55. to
  56. .Xr strftime 3 .
  57. .Ss setdate format
  58. The heck they managed to put in their manpage, followed by
  59. .Xr strftime 3
  60. format with reusing option formatting.
  61. .Bl -tag -width 6n
  62. .It POSIX
  63. .Sm off
  64. .Ar mmddhhmm
  65. .Oo
  66. .Ar cc
  67. .Op Ar yy
  68. .Oc
  69. .Sm on
  70. which makes it
  71. .Sm off
  72. .Ar %m%d%H%M
  73. .Oo
  74. .Ar \&%C
  75. .Op Ar %y
  76. .Oc
  77. .Sm on
  78. .It Nx , Fx , Ox
  79. .Sm off
  80. .Oo Oo Oo Oo Oo
  81. .Ar CC Oc
  82. .Ar yy Oc
  83. .Ar mm Oc
  84. .Ar dd Oc
  85. .Ar HH Oc Ar MM Oo
  86. .Li \&. Ar SS Oc
  87. .Sm on
  88. which makes it
  89. .Sm off
  90. .Oo Oo Oo Oo Oo
  91. .Ar \&%C Oc
  92. .Ar %y Oc
  93. .Ar %m Oc
  94. .Ar %d Oc
  95. .Ar %H Oc Ar %M Oo
  96. .Li \&. Ar %S Oc
  97. .Sm on
  98. .It GNU
  99. .Sm off
  100. .Ar MMDDhhmm
  101. .Oo
  102. .Ar CC
  103. .Op Ar YY
  104. .Oc
  105. .Op Ar .ss
  106. .Sm on
  107. which makes it
  108. .Sm off
  109. .Ar %m%d%H%M
  110. .Oo
  111. .Ar \&%C
  112. .Op Ar %y
  113. .Oc
  114. .Op Ar .%S
  115. .Sm on
  116. .It BusyBox
  117. Recognized formats:
  118. .Sm off
  119. .Bl -item -compact
  120. .It
  121. .Ar hh:mm
  122. .Op Ar :ss
  123. .It
  124. .Op Ar YYYY\&.
  125. .Ar MM.DD-hh:mm
  126. .Op Ar :ss
  127. .It
  128. .Sm on
  129. .Ar YYYY-MM-DD
  130. .Sm off
  131. .Ar hh:mm
  132. .Op Ar :ss
  133. .It
  134. .Oo Oo Oo Oo Oo
  135. .Ar YY Oc
  136. .Ar YY Oc
  137. .Ar MM Oc
  138. .Ar DD Oc
  139. .Ar hh Oc
  140. .Ar mm
  141. .Op Ar .ss
  142. .Sm on
  143. .El
  144. .It At v6
  145. .Sm off
  146. .Ar mmddhhmm
  147. .Op Ar yy
  148. .Sm on
  149. which makes it
  150. .Sm off
  151. .Ar %m%d%H%M
  152. .Op Ar %y
  153. .Sm on
  154. .It At v10 , Bx 4.2
  155. .Sm off
  156. .Ar yymmddhhmm
  157. .Op Ar .ss
  158. .Sm on
  159. which makes it
  160. .Sm off
  161. .Ar %y%m%d%H%M
  162. .Op Ar .%S
  163. .Sm on
  164. .El
  165. .Sh SOURCE
  166. .Nx 8.0 ,
  167. .Fx 12.0 ,
  168. .Ox 6.4 ,
  169. GNU coreutils 8.30,
  170. BusyBox 1.30.1,
  171. .At v6 ,
  172. .At v10 ,
  173. .Bx 4.2
  174. .Sh AUTHORS
  175. .An Haelwenn (lanodan) Monnier Aq Mt contact+c-u-d@hacktivis.me