openharmony 鸿蒙 kernel-small-debug-shell-cmd-date

2022-08-09 浏览 (833)

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

ParameterDescriptionValue Range
--helpDisplays help information.N/A
+FormatPrints the date and time in the specified format.Placeholders listed in --help
-uDisplays UTC (not the current time zone).N/A

Usage Guidelines

  • If no parameter is specified, the system date and time in UTC format 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.

Note

The shell does not support date -u. mksh supports it. To switch to mksh, run cd bin and ./mksh.

Example

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

Output

System date in the specified format:

OHOS:/$ date +%Y--%m--%d
1970--01--01

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Kernel

harmony 鸿蒙Kernel Coding Specification

harmony 鸿蒙Standard Libraries

harmony 鸿蒙Interrupt Management

harmony 鸿蒙Event

harmony 鸿蒙Mutex

harmony 鸿蒙Queue

harmony 鸿蒙Semaphore

harmony 鸿蒙Doubly Linked List

harmony 鸿蒙Memory Management

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/10a6f001eda9414bb0b80dc1ae2374cd