summaryrefslogtreecommitdiff
path: root/Base
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2022-02-25 21:40:28 +0100
committerLinus Groh <mail@linusgroh.de>2022-03-08 23:30:47 +0100
commit7bd68c86d3ed6cac4c3abb165b3cc6b91973d41a (patch)
tree1886283d615610bf6301e8f42c841fedaa0300dc /Base
parent01dc718f079bb9c5c56e408f235df52852270d11 (diff)
downloadserenity-7bd68c86d3ed6cac4c3abb165b3cc6b91973d41a.zip
date: Allow using a custom format string
This commit adds an optional string positional argument which is used a custom format string for the date.
Diffstat (limited to 'Base')
-rw-r--r--Base/usr/share/man/man1/date.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/Base/usr/share/man/man1/date.md b/Base/usr/share/man/man1/date.md
index e05d0096a6..8ec6c346f7 100644
--- a/Base/usr/share/man/man1/date.md
+++ b/Base/usr/share/man/man1/date.md
@@ -5,7 +5,7 @@ date - print or set the system date and time
## Synopsis
```**sh
-$ date [--set date] [--unix] [--iso-8601] [--rfc-3339] [--rfc-5322]
+$ date [--set date] [--unix] [--iso-8601] [--rfc-3339] [--rfc-5322] [format-string]
```
## Description
@@ -21,12 +21,19 @@ or print the system date and time in various formats.
* `-r`, `--rfc-3339`: Print date in RFC 3339 format
* `-R`, `--rfc-5322`: Print date in RFC 5322 format
+## Arguments
+
+* `format-string`: Custom format to print the date in. Must start with a '+' character.
+
## Examples
```sh
# Print the current date and time in ISO 8601 format
$ date --iso-8601
+# Print the current date in a custom format
+$ date +%Y-%m-%d
+
# Set date to 1610017485 (UNIX time)
$ date -s 1610017485
```