2014-03-03 08:25:49 +11:00
|
|
|
# date
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Set or display the system date.
|
2024-01-31 07:20:27 -03:00
|
|
|
> More information: <https://keith.github.io/xcode-man-pages/date.1.html>.
|
2014-03-03 08:25:49 +11:00
|
|
|
|
2016-10-06 23:29:04 +01:00
|
|
|
- Display the current date using the default locale's format:
|
2014-03-03 08:25:49 +11:00
|
|
|
|
2022-02-14 03:21:43 -08:00
|
|
|
`date +%c`
|
2014-03-03 08:25:49 +11:00
|
|
|
|
2016-10-06 12:05:12 +01:00
|
|
|
- Display the current date in UTC and ISO 8601 format:
|
2014-03-03 08:25:49 +11:00
|
|
|
|
2022-02-14 03:21:43 -08:00
|
|
|
`date -u +%Y-%m-%dT%H:%M:%SZ`
|
2016-09-08 15:46:34 +12:00
|
|
|
|
2016-10-06 12:05:12 +01:00
|
|
|
- Display the current date as a Unix timestamp (seconds since the Unix epoch):
|
2016-09-08 15:46:34 +12:00
|
|
|
|
|
|
|
`date +%s`
|
|
|
|
|
2016-10-06 12:05:12 +01:00
|
|
|
- Display a specific date (represented as a Unix timestamp) using the default format:
|
2016-09-08 15:46:34 +12:00
|
|
|
|
2024-06-09 12:18:06 +02:00
|
|
|
`date -r {{1473305798}}`
|