2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: date now
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
Get the current date.
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
|
|
|
```> date now ```
|
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
Get the current date and display it in a given format string.
|
|
|
|
```shell
|
|
|
|
> date now | date format "%Y-%m-%d %H:%M:%S"
|
|
|
|
```
|
2022-02-24 13:17:05 +01:00
|
|
|
|
|
|
|
Get the time duration from 2019-04-30 to now
|
|
|
|
```shell
|
|
|
|
> (date now) - 2019-05-01
|
|
|
|
```
|
|
|
|
|
|
|
|
Get the time duration since a more accurate time
|
|
|
|
```shell
|
|
|
|
> (date now) - 2019-05-01T04:12:05.20+08:00
|
|
|
|
```
|
2022-03-01 14:05:29 +01:00
|
|
|
|
|
|
|
Get current time in full RFC3339 format with timezone
|
|
|
|
```shell
|
|
|
|
> date now | debug
|
|
|
|
```
|