Menu

1 / 2

A 150-Line `whentime tokyo london ny` CLI in Rust — and Why You Need IANA tzdata, Not 'UTC + N'

DEV Community·SEN LLC·6 months ago
#Ez0VwzXB
#rust#cli#productivity#devops#tokyo
Reading 0:00
15s threshold

When you're working across time zones and someone asks "what time is it in Tokyo?", the answer should be one terminal command away:

$ whentime tokyo london ny utc

Here's a 150-line zero-deps Rust CLI that does exactly that, plus the gotchas you discover when you stop pretending UTC offsets are integers.

🦀 Source on GitHub : https://github.com/sen-ltd/whentime

📦 Build & run : see below

Requirements

Four constraints I gave myself:

Friendly aliases — typing Asia/Tokyo every time loses to typing tokyo .

IANA names too — when an alias isn't in the table ( Europe/Sofia ), still let the user pass the IANA name directly.

Honest DST — London is +01:00 in July and +00:00 in January. No averaging to "+0.5".

A "From me" column — the actual delta from the user's wall clock, not yet another absolute UTC offset.

That last one means the program needs to know the user's own zone.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.