into duration
for conversions> into duration {flags} ...rest
--unit, -u {string}
: Unit to convert number into (will have an effect only with integer input)...rest
: for a data structure input, convert data at the given cell pathsinput | output |
---|---|
duration | duration |
int | duration |
string | duration |
table | table |
Convert duration string to duration value
>'7min'|into duration
7min
Convert compound duration string to duration value
>'1day 2hr 3min 4sec'|into duration
1day2hr3min4sec
Convert table of duration strings to table of duration values
> [[value]; ['1sec'] ['2min'] ['3hr'] ['4day'] ['5wk']] |into durationvalue
╭───┬───────╮
│# │ value │
├───┼───────┤
│0│1sec│
│1│2min│
│2│3hr│
│3│4day│
│4│5wk│
╰───┴───────╯
Convert duration to duration
>420sec|into duration
7min
Convert a number of ns to duration
>1_234_567|into duration
1ms234µs567ns
Convert a number of an arbitrary unit to duration
>1_234|into duration--unitms
1sec234ms
Max duration value is i64::MAX nanoseconds; max duration time unit is wk (weeks).
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/into_duration.html