1 Star 0 Fork 4.9K

丛林 / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
kernel-small-debug-shell-cmd-date.md 3.34 KB
一键复制 编辑 原始数据 按行查看 历史
Annie_wang 提交于 2022-05-19 22:02 . update docs

date

Command Function

This command is used to query the system date and time.

Syntax

  • date
  • date --help
  • date +[Format]
  • date -u

Parameters

Table 1 Parameter description

Parameter

Description

Value Range

--help

Displays help information.

N/A

+Format

Prints the date and time in the specified Format.

Placeholders listed in --help

-u

Displays UTC instead of the current time zone.

N/A

Usage

  • If no parameter is specified, the system UTC date and time are displayed by default.
  • The --help, +Format, and -u parameters are mutually exclusive.
  • Currently, this command cannot be used to set the time or date.

Example

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

Output

System date in the specified format:

OHOS:/$ date +%Y--%m--%d
1970--01--01
1
https://gitee.com/jungle8023/docs.git
git@gitee.com:jungle8023/docs.git
jungle8023
docs
docs
master

搜索帮助