2019-10-01 01:30:17 +00:00
|
|
|
# date
|
|
|
|
|
|
|
|
Use `date` to get the current date and time. Defaults to local timezone but you can get it in UTC too.
|
|
|
|
|
|
|
|
## Flags
|
|
|
|
|
|
|
|
--utc
|
2019-10-01 14:21:56 +00:00
|
|
|
Returns the current date and time in UTC
|
2019-10-01 01:30:17 +00:00
|
|
|
|
|
|
|
--local
|
2019-10-01 14:21:56 +00:00
|
|
|
Returns the current date and time in your local timezone
|
2019-10-01 01:30:17 +00:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> date
|
2020-06-23 18:21:47 +00:00
|
|
|
──────────┬────────
|
|
|
|
year │ 2020
|
|
|
|
month │ 6
|
|
|
|
day │ 21
|
|
|
|
hour │ 18
|
|
|
|
minute │ 3
|
|
|
|
second │ 43
|
|
|
|
timezone │ -04:00
|
|
|
|
──────────┴────────
|
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
2019-10-01 01:30:17 +00:00
|
|
|
> date --utc
|
2020-06-23 18:21:47 +00:00
|
|
|
──────────┬──────
|
|
|
|
year │ 2020
|
|
|
|
month │ 6
|
|
|
|
day │ 21
|
|
|
|
hour │ 22
|
|
|
|
minute │ 3
|
|
|
|
second │ 53
|
|
|
|
timezone │ UTC
|
|
|
|
──────────┴──────
|
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
2019-10-01 01:30:17 +00:00
|
|
|
> date --local
|
2020-06-23 18:21:47 +00:00
|
|
|
──────────┬────────
|
|
|
|
year │ 2020
|
|
|
|
month │ 6
|
|
|
|
day │ 21
|
|
|
|
hour │ 18
|
|
|
|
minute │ 4
|
|
|
|
second │ 3
|
|
|
|
timezone │ -04:00
|
|
|
|
──────────┴────────
|
2019-10-01 01:30:17 +00:00
|
|
|
```
|