Skip to content

Correct date now docs to reflect current behavior. #1875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions commands/docs/date_now.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Get the current date and display it in a given format string.

```

Get current time in full RFC 3339 format with time zone.
```nu
> date now | format date %+

```

Get the time duration since 2019-04-30.
```nu
> (date now) - 2019-05-01
Expand All @@ -47,8 +53,8 @@ Get the time duration since a more specific time.

```

Get current time in full RFC 3339 format with time zone.
Get current time in RFC 2289 format with time zone.
```nu
> date now | debug
> date now | format date

```
11 changes: 11 additions & 0 deletions commands/docs/format_date.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ Format a given date using a given format string.
> "2021-10-22 20:00:12 +01:00" | format date "%Y-%m-%d"
2021-10-22
```

Format a given date-time using RFC3339 format.
```nu
> "2021-10-22 20:00:12 +01:00" | format date %+
2021-10-22T20:00:12+01:00
```

Format current date-time using RFC3339 format.
```nu
> date now | format date %+
```
Loading