sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

date.1 (1558B)


      1 .Dd 2015-10-08
      2 .Dt DATE 1
      3 .Os sbase
      4 .Sh NAME
      5 .Nm date
      6 .Nd print or set date and time
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Fl d Ar time
     10 .Op Fl u
     11 .Oo
     12 .Cm + Ns Ar format |
     13 .Sm off
     14 .Ar mmddHHMM Oo Oo Ar CC Oc Ar yy Oc
     15 .Sm on
     16 .Oc
     17 .Sh DESCRIPTION
     18 .Nm
     19 prints the date and time according to
     20 .Xr locale 7
     21 or
     22 .Ar format
     23 using
     24 .Xr strftime 3
     25 or sets the date.
     26 .Sh OPTIONS
     27 .Bl -tag -width Ds
     28 .It Fl d Ar time
     29 Print
     30 .Ar time
     31 given as the number of seconds since the
     32 Unix epoch 1970-01-01T00:00:00Z.
     33 .It Fl u
     34 Print or set UTC time instead of local time.
     35 .El
     36 .Pp
     37 An operand with a leading plus
     38 .Pq Cm +
     39 sign signals a user-defined format string using
     40 .Xr strftime 3
     41 conversion specifications.
     42 .Pp
     43 An operand without a leading plus sign is interpreted as a value
     44 for setting the system's current date and time.
     45 The canonical representation for setting the date and time is:
     46 .Pp
     47 .Bl -tag -width Ds -compact -offset indent
     48 .It Ar mm
     49 The month of the year, from 01 to 12.
     50 .It Ar dd
     51 The day of the month, from 01 to 31.
     52 .It Ar HH
     53 The hour of the day, from 00 to 23.
     54 .It Ar MM
     55 The minute of the hour, from 00 to 59.
     56 .It Ar CC
     57 The first two digits of the year (the century).
     58 .It Ar yy
     59 The second two digits of the year.
     60 If
     61 .Ar yy
     62 is specified, but
     63 .Ar CC
     64 is not, a value for
     65 .Ar yy
     66 between 69 and 99 results in a
     67 .Ar CC
     68 value of 19.
     69 Otherwise, a
     70 .Ar CC
     71 value of 20 is used.
     72 .El
     73 .Pp
     74 The century and year are optional.
     75 The default is the current year.
     76 .Sh STANDARDS
     77 The
     78 .Nm
     79 utility is compliant with the
     80 .St -p1003.1-2013
     81 specification.
     82 .Pp
     83 The
     84 .Op Fl d
     85 flag is an extension to that specification.