


date(1)                   User Commands                   date(1)



NAME
     date - write the date and time

SYNOPSIS
     /usr/bin/date [-u] [+_f_o_r_m_a_t]
     /usr/bin/date [-a [-]_s_s_s._f_f_f]
     /usr/bin/date [-u] [[_m_m_d_d]_H_H_M_M | _m_m_d_d_H_H_M_M[_c_c]_y_y][._S_S]

     /usr/xpg4/bin/date [-u] [+_f_o_r_m_a_t]
     /usr/xpg4/bin/date [-a [-]_s_s_s._f_f_f]
     /usr/xpg4/bin/date [-u] [[_m_m_d_d]_H_H_M_M | _m_m_d_d_H_H_M_M[_c_c]_y_y][._S_S]

AVAILABILITY
  /usr/bin/date
     SUNWcsu

  /usr/xpg4/bin/date
     SUNWxcu4

DESCRIPTION
     The date utility writes the date and time to standard output
     or  attempts  to  set the system date and time.  By default,
     the current date and time will be written.

     Specifications of native language translations of month  and
     weekday  names  are  supported.  The month and weekday names
     used for a language are based on the locale specified by the
     environment variable LC_TIME; see environ(5).

     The following is the default form for the "C" locale:

          %_a %_b %_e %_T %_Z %_Y

     for example,

          Fri Dec 23 10:10:42 EST 1988

OPTIONS
     The following options are supported:

     -a [-]_s_s_s._f_f_f
                 Slowly adjust the time by _s_s_s._f_f_f  seconds  (_f_f_f
                 represents fractions of a second).  This adjust-
                 ment can be positive or negative.  The  system's
                 clock  will  be  sped up or slowed down until it
                 has drifted by the number of seconds specified.

     -u           Display (or set) the  date  in  Greenwich  Mean
                 Time  (GMT-universal time), bypassing the normal
                 conversion to (or from) local time.





SunOS 5.5.1         Last change: 15 Sep 1995                    1






date(1)                   User Commands                   date(1)



OPERANDS
     The following operands are supported:

     +_f_o_r_m_a_t     If the argument begins with  +,  the  output  of
                 date  is  the  result  of passing _f_o_r_m_a_t and the
                 current  time  to  strftime().   date  uses  the
                 conversion    specifications   listed   on   the
                 strftime(3C) manual page,  with  the  conversion
                 specification   for  %C  determined  by  whether
                 /usr/bin/date or /usr/xpg4/bin/date is used:

                 /usr/bin/date     Locale's   date    and    time
                                   representation.   This  is the
                                   default output for date.

                 /usr/xpg4/bin/date
                                   Century (a year divided by 100
                                   and  truncated  to an integer)
                                   as a decimal number [00-99].

                 The string is always terminated with a  NEWLINE.
                 An  argument  containing  blanks must be quoted;
                 see the EXAMPLES section.

     _m_m          Month number
     _d_d          Day number in the month
     _H_H          Hour number (24 hour system)
     _M_M          Minute number
     _S_S          Second number
     _c_c          Century minus one
     _y_y          Last 2 digits of the year number

                 The month, day, year, and century may  be  omit-
                 ted; the current values are applied as defaults.
                 For example:

                         date 10080045

                 sets the date to Oct 8, 12:45 a.m.  The  current
                 year is the default because no year is supplied.
                 The system operates in GMT.  date takes care  of
                 the  conversion  to  and from local standard and
                 daylight time.  Only the super-user  may  change
                 the  date.   After successfully setting the date
                 and time, date displays the new  date  according
                 to the default format.  The date command uses TZ
                 to determine the correct time zone  information;
                 see environ(5).

EXAMPLES
     The command




SunOS 5.5.1         Last change: 15 Sep 1995                    2






date(1)                   User Commands                   date(1)



          example% date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'

     generates as output:

          DATE: 08/01/76
          TIME: 14:45:05
     The command

          example# date 1234.56

     sets the current time to 12:34:56.

ENVIRONMENT
     See environ(5) for descriptions of the following environment
     variables  that  affect  the  execution  of date:  LC_CTYPE,
     LC_TIME, LC_MESSAGES, and NLSPATH.

     TZ          Determine the timezone in  which  the  time  and
                 date are written, unless the -u option is speci-
                 fied.  If the TZ variable is not set and the - u
                 is not specified, the system default timezone is
                 used.

EXIT STATUS
     The following exit values are returned:
     0         Successful completion.
     >0        An error occurred.

SEE ALSO
     strftime(3C), environ(5)

DIAGNOSTICS
     no permission       You are not the super-user and you tried
                         to change the date.
     bad conversion      The date set is syntactically incorrect.

NOTES
     If you attempt to set the current date to one of  the  dates
     that the standard and alternate time zones change (for exam-
     ple, the date that daylight time is starting or ending), and
     you  attempt  to  set  the  time  to  a time in the interval
     between the end of standard time and the  beginning  of  the
     alternate  time  (or  the  end of the alternate time and the
     beginning of standard time), the results are unpredictable.











SunOS 5.5.1         Last change: 15 Sep 1995                    3



