date
Command Function
This command is used to query and set the system date and time.
Syntax
date
date --help
date +[Format]
date -s_ _[YY/MM/DD]
date_ -s [hh:mm:ss]_
date -r [Filename]
Parameters
Table 1 Parameter description
Sets the system date and separates the year, month, and day by slashes (/). |
||
Sets the system time and separates the hour, minute, and second by colons (:). |
||
Usage
- If the date parameter is not specified, the current system date and time are displayed by default.
- The --help, +Format, -s, and -r parameters are mutually exclusive.
Example
Example:
Run date +%Y--%m--%d.