home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / gcc263-utildoc.lha / gnu / man / man1 / date.1 < prev    next >
Encoding:
Text File  |  1994-12-19  |  5.9 KB  |  265 lines

  1.  
  2.  
  3.  
  4. DATE(1L)                                                 DATE(1L)
  5.  
  6.  
  7. NNAAMMEE
  8.        date - print or set the system date and time
  9.  
  10. SSYYNNOOPPSSIISS
  11.        ddaattee  [-u] [-d datestr] [-s datestr] [--utc] [--universal]
  12.        [--date=datestr]  [--set=datestr]   [--help]   [--version]
  13.        [+FORMAT] [MMDDhhmm[[CC]YY][.ss]]
  14.  
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.        This  manual page documents the GNU version of ddaattee.  ddaattee
  18.        with no arguments prints the current time and date (in the
  19.        format  of  the `%c' directive described below).  If given
  20.        an argument that starts with a `+', it prints the  current
  21.        time  and  date  in  a format controlled by that argument,
  22.        which has the same format as the format string  passed  to
  23.        the `strftime' function.  Except for directives that start
  24.        with `%', characters in that string are printed unchanged.
  25.  
  26.        The directives are:
  27.  
  28.        %      a literal %
  29.  
  30.        n      a newline
  31.  
  32.        t      a horizontal tab
  33.  
  34.        Time fields:
  35.  
  36.        %H     hour (00..23)
  37.  
  38.        %I     hour (01..12)
  39.  
  40.        %k     hour ( 0..23)
  41.  
  42.        %l     hour ( 1..12)
  43.  
  44.        %M     minute (00..59)
  45.  
  46.        %p     locale's AM or PM
  47.  
  48.        %r     time, 12-hour (hh:mm:ss [AP]M)
  49.  
  50.        %s     seconds  since  1970-01-01 00:00:00 UTC (a nonstan-
  51.               dard extension)
  52.  
  53.        %S     second (00..61)
  54.  
  55.        %T     time, 24-hour (hh:mm:ss)
  56.  
  57.        %X     locale's time representation (%H:%M:%S)
  58.  
  59.        %Z     time zone (e.g., EDT), or nothing if no  time  zone
  60.               is determinable
  61.  
  62.  
  63.  
  64. FSF                    GNU Shell Utilities                      1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DATE(1L)                                                 DATE(1L)
  71.  
  72.  
  73.        Date fields:
  74.  
  75.        %a     locale's abbreviated weekday name (Sun..Sat)
  76.  
  77.        %A     locale's  full  weekday name, variable length (Sun-
  78.               day..Saturday)
  79.  
  80.        %b     locale's abbreviated month name (Jan..Dec)
  81.  
  82.        %B     locale's full month  name,  variable  length  (Jan-
  83.               uary..December)
  84.  
  85.        %c     locale's  date  and  time  (Sat Nov 04 12:02:33 EST
  86.               1989)
  87.  
  88.        %d     day of month (01..31)
  89.  
  90.        %D     date (mm/dd/yy)
  91.  
  92.        %h     same as %b
  93.  
  94.        %j     day of year (001..366)
  95.  
  96.        %m     month (01..12)
  97.  
  98.        %U     week number of year with Sunday  as  first  day  of
  99.               week (00..53)
  100.  
  101.        %w     day of week (0..6) with 0 corresponding to Sunday
  102.  
  103.        %W     week  number  of  year  with Monday as first day of
  104.               week (00..53)
  105.  
  106.        %x     locale's date representation (mm/dd/yy)
  107.  
  108.        %y     last two digits of year (00..99)
  109.  
  110.        %Y     year (1970...)
  111.  
  112.        By default, ddaattee pads numeric  fields  with  zeroes.   GNU
  113.        ddaattee  recognizes  the  following nonstandard numeric modi-
  114.        fiers:
  115.  
  116.        -      (hyphen) do not pad the field
  117.  
  118.        _      (underscore) pad the field with spaces
  119.  
  120.        If given an argument that does not start  with  `+',  ddaattee
  121.        sets  the  system  clock to the time and date specified by
  122.        that argument.  The argument must consist entirely of dig-
  123.        its, which have the following meaning:
  124.  
  125.        MM     month
  126.  
  127.  
  128.  
  129.  
  130. FSF                    GNU Shell Utilities                      2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DATE(1L)                                                 DATE(1L)
  137.  
  138.  
  139.        DD     day within month
  140.  
  141.        hh     hour
  142.  
  143.        mm     minute
  144.  
  145.        CC     first two digits of year (optional)
  146.  
  147.        YY     last two digits of year (optional)
  148.  
  149.        ss     second (optional)
  150.  
  151.        Only the superuser can set the system clock.
  152.  
  153.    OOPPTTIIOONNSS
  154.        _-_d _d_a_t_e_s_t_r_, _-_-_d_a_t_e _d_a_t_e_s_t_r
  155.               Display  the  time  and  date specified in _d_a_t_e_s_t_r,
  156.               which can be in almost any common format.  The dis-
  157.               play  is  in  the  default  output format, or if an
  158.               argument starting with `+' is given to ddaattee, in the
  159.               format specified by that argument.
  160.  
  161.        _-_-_h_e_l_p Print  a  usage message on standard output and exit
  162.               successfully.
  163.  
  164.        _-_s _d_a_t_e_s_t_r_, _-_-_s_e_t _d_a_t_e_s_t_r
  165.               Set the time and date to _d_a_t_e_s_t_r, which can  be  in
  166.               almost  any  common  format.   It can contain month
  167.               names, timezones, `am' and `pm', etc.
  168.  
  169.        _-_u_, _-_-_u_n_i_v_e_r_s_a_l
  170.               Print or set the time and date in Coordinated  Uni-
  171.               versal  Time  (also  known  as Greenwich Mean Time)
  172.               instead of in local (wall clock) time.
  173.  
  174.        _-_-_v_e_r_s_i_o_n
  175.               Print version information on standard  output  then
  176.               exit successfully.
  177.  
  178. EEXXAAMMPPLLEESS
  179.        To print the date of the day before yesterday
  180.  
  181.               date --date '2 days ago'
  182.  
  183.        To  print  the  date  of  the day three months and one day
  184.        hence
  185.  
  186.               date --date '3 months 1 day'
  187.  
  188.        To print the day of year of Christmas in the current year
  189.  
  190.               date --date '25 Dec' +%j
  191.  
  192.        To print the current date in a format including  the  full
  193.  
  194.  
  195.  
  196. FSF                    GNU Shell Utilities                      3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DATE(1L)                                                 DATE(1L)
  203.  
  204.  
  205.        month name and the day of the month
  206.  
  207.               date '+%B %d'
  208.  
  209.        But  this  may  not be what you want because for the first
  210.        nine days of the month, the `%d' expands to a  zero-padded
  211.        two-digit field, for example `date -d 1-may '+%B %d'' will
  212.        print `May 01'.
  213.  
  214.        To print the same date but without the  leading  zero  for
  215.        one-digit  days  of month, you can use the nonstandard `-'
  216.        modifier to suppress the padding altogether.
  217.  
  218.               date -d 1-may '+%B %-d'
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. FSF                    GNU Shell Utilities                      4
  263.  
  264.  
  265.