EXAMPLES
Example 1: Generating output
The command
example% date '+DATE: %m/%d/%y%nTIME:%H:%M:%S'
generates as output
DATE:
TIME: 14:45:05
Example 2: Setting the current time
The command
example# date 1234.56
sets the current time to 12:34:56.
ENVIRONMENT VARIABLES
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 specified. 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.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
/usr/bin/date
SunOS 5.8 Last change: 20 Apr 1999 3
User Commands date(1)
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcsu |
|_____________________________|_____________________________|
| CSI | enabled |
|_____________________________|_____________________________|
/usr/xpg4/bin/date
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWxcu4 |
|_____________________________|_____________________________|
| CSI | enabled |
|_____________________________|_____________________________|
SEE ALSO
strftime(
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.
Using the date command from within windowing environments to
change the date can lead to unpredictable results and is
unsafe. It may also be unsafe in the multi-user mode, that
is, outside of a windowing system, if the date is changed
rapidly back and forth. The recommended method of changing
the date is 'date -a'.
SunOS 5.8 Last change: 20 Apr 1999 4
bash-2.03#
