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 (2573B)


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