format date
for date> format date {flags} (format string)
--list, -l
: lists strftime cheatsheetformat string
: the desired format dateinput | output |
---|---|
datetime | string |
string | string |
Format a given date-time using the default format (RFC 2822).
>'2021-10-22 20:00:12 +01:00'|into datetime|format date
Fri, 22Oct202120:00:12+0100
Format a given date-time as a string using the default format (RFC 2822).
>"2021-10-22 20:00:12 +01:00"|format date
Fri, 22Oct202120:00:12+0100
Format the current date-time using a given format string.
>date now|format date"%Y-%m-%d %H:%M:%S"
Format the current date using a given format string.
>date now|format date"%Y-%m-%d %H:%M:%S"
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
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/format_date.html