diff --git a/pages/common/date.md b/pages/linux/date.md similarity index 57% rename from pages/common/date.md rename to pages/linux/date.md index a0fa47e793..dcba66c1e5 100644 --- a/pages/common/date.md +++ b/pages/linux/date.md @@ -9,3 +9,11 @@ - Display the date in UTC and ISO 8601 format: `date -u +"%Y-%m-%dT%H:%M:%SZ"` + +- Display the number of seconds since the unix epoch: + +`date +%s` + +- Convert a unix epoch timestamp to a date: + +`date -d @1473305798` diff --git a/pages/osx/date.md b/pages/osx/date.md new file mode 100644 index 0000000000..4f89139b8d --- /dev/null +++ b/pages/osx/date.md @@ -0,0 +1,19 @@ +# date + +> Set or display the system date. + +- Display the date using the default locale: + +`date +"%c"` + +- Display the date in UTC and ISO 8601 format: + +`date -u +"%Y-%m-%dT%H:%M:%SZ"` + +- Display the number of seconds since the unix epoch: + +`date +%s` + +- Juggle a timestamp representing seconds since the Unix expoch to a date: + +`date -j -r 1473305798`