Datetime
| Description: | Represents a specific point in time using international standard date time descriptors |
| Annotation: | datetime |
| Literal syntax: | RFC 3339 |
Date-only: 2022-02-02 | |
Date and time (GMT): 2022-02-02T14:30:00 | |
Date and time including timezone offset: 2022-02-02T14:30:00+05:00 | |
| Casts: | into datetime |
| See also: | Types of Data - Dates |
Additional language notes
Dates and times are held together in the
datetimetype. Date values used by the system are timezone-aware. A datetime literal without a timezone offset uses UTC, whiledate nowreturns the current time in the local timezone.2022-02-02T14:30:00 | format date "%+" # => 2022-02-02T14:30:00+00:00 2022-02-02T14:30:00+05:00 | format date "%+" # => 2022-02-02T14:30:00+05:00
Common commands that can be used with datetime
Many of Nushell's builtin commands are datetime aware and output or use datetime values for fields and expressions. For example:
dateand its subcommandsformat dateinto datetimels(themodifiedcolumn)ps --long(thestart_timecolumn)sys host(theboot_timecolumn)