From 31cc8392a61295ea94c8ce8325e2c58de650451c Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sun, 23 Oct 2022 17:19:15 +0100 Subject: [PATCH] date: add week number example and other tweaks (#9136) --- pages/common/date.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pages/common/date.md b/pages/common/date.md index 7e716fe77d..797c6725e4 100644 --- a/pages/common/date.md +++ b/pages/common/date.md @@ -5,21 +5,21 @@ - Display the current date using the default locale's format: -`date +"%c"` +`date +%c` -- Display the current date in UTC and ISO 8601 format: +- Display the current date in UTC, using the ISO 8601 format: -`date -u +"%Y-%m-%dT%H:%M:%SZ"` +`date -u +%Y-%m-%dT%H:%M:%SZ` - Display the current date as a Unix timestamp (seconds since the Unix epoch): `date +%s` -- Display a specific date (represented as a Unix timestamp) using the default format: +- Convert a date specified as a Unix timestamp to the default format: -`date -d @1473305798` +`date -d @{{1473305798}}` -- Convert a specific date to the Unix timestamp format: +- Convert a given date to the Unix timestamp format: `date -d "{{2018-09-01 00:00}}" +%s --utc` @@ -30,3 +30,7 @@ - Set the current date using the format `MMDDhhmmYYYY.ss` (`YYYY` and `.ss` are optional): `date {{093023592021.59}}` + +- Display the current ISO week number: + +`date +%V`