# 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

Parameter

Description

Value Range

--help

Displays the help information.

N/A

+Format

Prints the date and time based on Format.

Placeholders listed in --help.

-s YY/MM/DD

Sets the system date and separates the year, month, and day by slashes (/).

>= 1970/01/01

-s hh:mm:ss

Sets the system time and separates the hour, minute, and second by colons (:).

N/A

-r Filename

Queries the modification time of the Filename file.

N/A

## 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**. ## Output **Figure 1** System date printed based on the specified format ![](figure/system-date-printed-based-on-the-specified-format.png "system-date-printed-based-on-the-specified-format")