2014-03-02 22:25:49 +01:00
|
|
|
# date
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Set or display the system date.
|
2014-03-02 22:25:49 +01:00
|
|
|
|
2016-10-06 13:05:12 +02:00
|
|
|
- Display the current date using the default locale's format:
|
2014-03-02 22:25:49 +01:00
|
|
|
|
|
|
|
`date +"%c"`
|
|
|
|
|
2016-10-06 13:05:12 +02:00
|
|
|
- Display the current date in UTC and ISO 8601 format:
|
2014-03-02 22:25:49 +01:00
|
|
|
|
2015-12-05 21:20:22 +01:00
|
|
|
`date -u +"%Y-%m-%dT%H:%M:%SZ"`
|
2016-09-08 05:46:34 +02:00
|
|
|
|
2016-10-06 13:05:12 +02:00
|
|
|
- Display the current date as a Unix timestamp (seconds since the Unix epoch):
|
2016-09-08 05:46:34 +02:00
|
|
|
|
|
|
|
`date +%s`
|
|
|
|
|
2016-10-06 13:05:12 +02:00
|
|
|
- Display a specific date (represented as a Unix timestamp) using the default format:
|
2016-09-08 05:46:34 +02:00
|
|
|
|
|
|
|
`date -d @1473305798`
|
2019-01-11 11:12:29 +01:00
|
|
|
|
|
|
|
- Convert a specific date to the Unix timestamp format:
|
|
|
|
|
|
|
|
`date -d "{{2018-09-01 00:00}}" +%s --utc`
|