bin/tznu
Jeffrey Serio 2148df813e Add tznu
2024-05-01 09:27:32 -05:00

23 lines
557 B
Plaintext
Executable File

#!/usr/bin/env nu
let continent = (
ls /usr/share/zoneinfo
| where name !~ "posix" and name !~ "right"
| where type == dir
| get name
| path basename
| input list $"\n(ansi red)Select a continent:(ansi reset)"
)
let city = (
ls ("/usr/share/zoneinfo" | path join $continent)
| get name
| path basename
| input list $"\n(ansi red)Select a city:(ansi reset)"
)
print ""
let timezone = ([$continent, "/", $city] | str join)
["The time in ", $timezone, " is:"] | str join | print
date now | date to-timezone $timezone