W3cubDocs

/Nushell

seq date for generators

Print sequences of dates.

Signature

> seq date {flags}

Flags

  • --output-format, -o {string}: prints dates in this format (defaults to %Y-%m-%d)
  • --input-format, -i {string}: give argument dates in this format (defaults to %Y-%m-%d)
  • --begin-date, -b {string}: beginning date range
  • --end-date, -e {string}: ending date
  • --increment, -n {int}: increment dates by this number
  • --days, -d {int}: number of days to print
  • --reverse, -r: print dates in reverse

Input/output types:

input output
nothing list<string>

Examples

print the next 10 days in YYYY-MM-DD format with newline separator

>seq date--days10

print the previous 10 days in YYYY-MM-DD format with newline separator

>seq date--days10-r

print the previous 10 days starting today in MM/DD/YYYY format with newline separator

>seq date--days10-o'%m/%d/%Y'-r

print the first 10 days in January, 2020

>seq date-b'2020-01-01'-e'2020-01-10'
╭───┬────────────╮
02020-01-01
12020-01-02
22020-01-03
32020-01-04
42020-01-05
52020-01-06
62020-01-07
72020-01-08
82020-01-09
92020-01-10
╰───┴────────────╯

print every fifth day between January 1st 2020 and January 31st 2020

>seq date-b'2020-01-01'-e'2020-01-31'-n5
╭───┬────────────╮
02020-01-01
12020-01-06
22020-01-11
32020-01-16
42020-01-21
52020-01-26
62020-01-31
╰───┴────────────╯

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/seq_date.html