1 Star 0 Fork 4.9K

fish / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
date.md 5.33 KB
一键复制 编辑 原始数据 按行查看 历史
NEEN 提交于 2021-03-12 17:59 . !197 Docs Update version 1.0.1

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]

Parameter Description

Table 1 Parameters

Parameter

Description

Value Range

--help

Uses the help.

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

Enter date +%Y--%m--%d.

Output

Figure 1 System date printed based on the specified format

1
https://gitee.com/fish_neil/docs.git
git@gitee.com:fish_neil/docs.git
fish_neil
docs
docs
master

搜索帮助