Package: time-in
time-inCLI tool to figure out the time somewhere elseInstallationRequirespython3.9+To install with pip, run:pip install time-inUsagetime-in tz --helpIf no timezone is passed, this usesfzfto let you select a timezone from a list of all timezones/common countries/capitals.Usage: time-in tz [OPTIONS] [TZ]...

Options:
  -f, --format TEXT              format for printing dates  [default: %Y-%m-%d %H:%M:%S %Z]
  -h, --hours INTEGER            print this many localized hours in timezones
  --print-local / --skip-local   print the local time as well
  -d, --date TEXT                date to print  [default: now]
  -P, --print-local-timezone     print the local timezone name as well
  -r, --round [up|down|nearest]  round the time to the nearest hour
  --print-info / --hide-info     print timezone info/difference
  -S, --sort-diffs               sort timezones by difference from the first timezone
  --help                         Show this message and exit.By default, this uses the current time, and prints the time in the timezone(s) passed.$time-intzUS/Eastern
Here(+0)2023-08-1610:51:04PDT
US/Eastern(+3)2023-08-1613:51:04EDTIf you want to print the time in the future, you can pass a date:$ time-in tz 'US/Eastern' --date '2023-10-16 10:30'or, in more human language:$ time-in tz 'US/Eastern' --date 'in 3 hours'Can show multiple timezones:$time-intzUS/MountainUS/CentralUS/Eastern
Here(+0)2023-08-1610:51:52PDT
US/Mountain(+1)2023-08-1611:51:52MDT
US/Central(+2)2023-08-1612:51:52CDT
US/Eastern(+3)2023-08-1613:51:52EDTTo label the timezones differently, you can prepend it with a label:$time-intz'East Coast: US/Eastern''UK: Europe/London'Here(+0)2023-08-1610:52:04PDT
EastCoast(+3)2023-08-1613:52:04EDT
UK(+8)2023-08-1618:52:04BSTThis can also show a range of dates, if you pass--hours:$time-intz'East Coast: US/Eastern''UK: Europe/London'--hours12--rounddown
Here(+0)[Aug16]101112131415161718192021EastCoast(+3)[Aug16]131415161718192021222300UK(+8)[Aug16]181920212223000102030405$time-intz-h6-rdown--print-local-timezoneUS/EasternEurope/LondonAsia/CalcuttaAsia/ShanghaiAsia/TokyoUS/Hawaii
America/Los_Angeles(+0)[Aug16]101112131415US/Eastern(+3)[Aug16]131415161718Europe/London(+8)[Aug16]181920212223Asia/Calcutta(+12.5)[Aug16]22:3023:3000:3001:3002:3003:30
Asia/Shanghai(+15)[Aug17]010203040506Asia/Tokyo(+16)[Aug17]020304050607US/Hawaii(-3)[Aug16]070809101112Example UsageI create a wrappertzscript that just passes the arguments totime-in tz:#!/bin/shexectime-intz"$@"And then have atz-friendsfunctions in my shell for my friends in different timezones:tz-friends () {
	tz "$@" 'East Coast: America/New_York' 'Japan: Asia/Tokyo' 'UK: Europe/London' 'India: Asia/Calcutta'
}$tz-friends
Here(+0)2023-08-1721:12:57PDT
EastCoast(+3)2023-08-1800:12:57EDT
Japan(+16)2023-08-1813:12:57JST
UK(+8)2023-08-1805:12:57BST
India(+12.5)2023-08-1809:42:57IST
$tz-friends-h6-rdown
Here(+0)[Aug17]212223000102EastCoast(+3)[Aug18]000102030405Japan(+16)[Aug18]131415161718UK(+8)[Aug18]050607080910India(+12.5)[Aug18]09:3010:3011:3012:3013:3014:30Testsgitclone'https://github.com/seanbreckenridge/time-in'cd./time_in
pipinstall'.[testing]'flake8./time_in
mypy./time_inAttributionsThe hours format was heavily influenced bythis scriptThanks tothis gistfor country/city data for timezones