You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add list<datetime> support to date commands #18534
I have done a basic search through the issue tracker to find similar or related issues.
I have made myself familiar with the available features of Nushell for the particular area this enhancement request touches.
Related problem
When trying to use date to-timezone in pipeline with list type annotation you get an error:
def 'date to-rfc-3339' [] : [datetime -> string,list<datetime>->list<string>] {
$in| date to-timezone UTC| format date $env.time_fmt_rfc_3339
}
Error: nu::parser::output_type_mismatch
× Command output doesn't match list<string>.
╭─[repl_entry #1:1:83]1 │ ╭─▶ def 'date to-rfc-3339' [] : [datetime -> string,list<datetime>->list<string>] {
2 │ │ $in| date to-timezone UTC| format date $env.time_fmt_rfc_3339
3 │ ├─▶ }
· ╰──── expected list<string>, but command outputs string or table
╰────
This also gives an LSP error Command output doesn't match list<string>.
This error only surfaced after and update to v0.114.0. But I'm not sure I had a change to use this command on a list of datetimes before. It would be nice to have, since I handle JSONs with timestamps and expect to encounter a list of timestamps at some point
Describe the solution you'd like
Add input/output support for list<datetime> -> list<OUT_TYPE> to date commands. So they would work like into string or format date: both with lists and single values, returning value of the same type they got in
Describe alternatives you've considered
Right I am using each + helper that runs first on list if it only has one element. But it's 2 more commands that aren't really necessary
Adding list<datetime> support to date commands would be very useful for data pipeline use cases. Currently you have to either loop or use each { |d| | format date ... } which kills performance on large datasets.
The implementation would likely follow the same pattern as how str commands handle lists — iterate over the input in the command's run method and apply the date operation to each element. The date commands already use the InputOutputType pattern for type checking, so adding Vec<DateTime> to the accepted input types should be straightforward.
A good reference is how str trim or str replace handle list input — they use input.flat_map to process each element.
Activity
cschanhniem commentedon Jul 8, 2026
Adding
list<datetime>support todatecommands would be very useful for data pipeline use cases. Currently you have to either loop or useeach { |d| | format date ... }which kills performance on large datasets.The implementation would likely follow the same pattern as how
strcommands handle lists — iterate over the input in the command'srunmethod and apply the date operation to each element. Thedatecommands already use theInputOutputTypepattern for type checking, so addingVec<DateTime>to the accepted input types should be straightforward.A good reference is how
str trimorstr replacehandle list input — they useinput.flat_mapto process each element.add list input type to more date commands (#18536)