commands
date — Format dates and times
Displays date/time. GNU -d accepts a specified input; -u displays UTC; +FORMAT controls presentation. -s changes the system clock and is not part of this lab. Use a fresh private workspace; live operations are VM-only.
Formal Syntax & Structure
linux syntaxlinux
date [OPTION]... [+FORMAT]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -d | option | Parse input date |
| -u | option | Use UTC |
| FORMAT | operand | Output format |
Return Value
exit status and output
Displays date/time. GNU -d accepts a specified input; -u displays UTC; +FORMAT controls presentation. -s changes the system clock and is not part of this lab.
Working Example
Example Snippetlinux
date -u -d '@0' '+%F'