date command
The date command displays or sets the date and time.
Enter the following command to determine what your system recognizes as
the current date and time:
/usr/bin/dateAttention: Do not change the date when the system is running with
more than one user.
The following formats can be used when setting the date with the Date parameter:
- mmddHHMM[YYyy] (default)
- mmddHHMM[yy]
The variables to the Date parameter are defined as follows:
| Item | Description |
|---|---|
| mm | Specifies the number of the month. |
| dd | Specifies the number of the day in the month. |
| HH | Specifies the hour in the day (using a 24-hour clock). |
| MM | Specifies the minute number. |
| YY | Specifies the first two digits of a four-digit year. |
| yy | Specifies the last two numbers of the year. |
With root authority, you can use the date command to
set the current date and time. For example:
date 021714252002Sets
the date to Feb. 17, 2002, and time to 14:25. For more information about
the date command,
see its description in Commands Reference, Volume 2.