Multi-timezone Time Management Tool
A modern multi-timezone time management application available as both a Terminal UI (TUI) and a Web Application, built with Rust.
Chinese version: README_zh
This repository ships a prek configuration in
.pre-commit-config.yaml for fast, commit-sized checks. It runs:
- file hygiene: trailing whitespace, final newline, merge conflicts, large files, YAML/TOML/JSON syntax, broken symlinks, and private keys
- Kingfisher secret scanning on the
staged files, with
--no-validate --redactso the hook stays offline and never prints a detected secret rumdl,cargo fmt --check, andcargo clippy -D warnings
Tests are deliberately excluded: cargo test stays in just test and CI.
The first Kingfisher run downloads and caches the pinned binary; later runs
reuse it. The auto-download hook needs bash, curl, and tar (unzip on
Windows); on Windows use the Bash shipped with Git for Windows.
The hooks call typos, rumdl, and the project toolchain directly, so run
just setup once first. Then install the Git hook once per clone (install
prek with brew install prek, uv tool install prek, or
cargo install --locked prek):
prek installRun every hook on every tracked file:
just hooksrepo: builtin is a prek extension, so this configuration is meant to be
run with prek rather than upstream pre-commit.
- Multi-timezone Support: Simultaneously display current time in multiple time zones
- Work Hours Display: Show configured work time ranges for each time zone
- Work Status Indicator: Visually indicate whether each time zone is within working hours
- Time Adjustment: Manually adjust time in any time zone, with other time zones updating synchronously
- Two Interfaces: Choose between Terminal UI or Web Application
- Configuration Sharing: Share timezone configurations via URL (Web version)
- Keyboard Shortcuts: Quick navigation and time adjustment
- Rust 1.80+ with
wasm32-unknown-unknowntarget - cargo-leptos (for Web version)
- Bun (for Tailwind CSS)
# Clone the repository
git clone https://github.com/akjong/longtime.git
cd longtime
# Install dependencies for Web version
bun install
cargo install cargo-leptos
rustup target add wasm32-unknown-unknown# Using Just
just dev-tui
# Or directly with cargo
cargo run -p longtime-tui -- -c timezones.toml# Using Just (recommended)
just dev-web
# Or directly with cargo-leptos
cd bin/web && cargo leptos watchThen open **http://127.0.0.1:3000** in your browser.
# Build all workspace crates
just build
# Build Web version for production
just build-webjust help # Show all available commandsThe TUI version uses a timezones.toml configuration file:
Example configuration file:
# Multi-timezone configuration file
[[timezones]]
name = "Beijing"
timezone = "Asia/Shanghai"
work_hours = { start = "09:00", end = "18:00" }
[[timezones]]
name = "New_York"
timezone = "America/New_York"
work_hours = { start = "09:00", end = "17:00" }
[[timezones]]
name = "London"
timezone = "Europe/London"
work_hours = { start = "09:00", end = "17:30" }
[[timezones]]
name = "Tokyo"
timezone = "Asia/Tokyo"
work_hours = { start = "09:30", end = "18:30" }
[[timezones]]
name = "Sydney"
timezone = "Australia/Sydney"
work_hours = { start = "09:00", end = "17:00" }Configuration item description:
name: Time zone display nametimezone: Time zone identifier (conforming to IANA time zone database format)work_hours: Work time range, includingstart(start time) andend(end time)
After starting the program, you'll see a list containing information for all configured time zones. Each time zone entry displays:
- Time zone name
- Current time (format: YYYY-MM-DD HH:MM:SS)
- Work hours range
- Current work status (work hours/non-work hours)
| Key | Function |
|---|---|
↑ (Up Arrow) |
Select previous time zone |
↓ (Down Arrow) |
Select next time zone |
← (Left Arrow) |
Adjust time backward by 30 minutes |
→ (Right Arrow) |
Adjust time forward by 30 minutes |
q |
Exit program |
The Web version provides a modern, responsive interface built with Leptos and TailwindCSS v4.
- Real-time Updates: Time updates every second automatically
- 12/24 Hour Toggle: Switch between time formats
- Add/Edit/Delete Timezones: Manage timezones directly in the browser
- Time Travel: Adjust displayed time with +/- 15min or +/- 1hr buttons
- Play/Pause: Freeze time display for comparison
- URL Sharing: Generate shareable links with your configuration
- LocalStorage: Configuration persists across browser sessions
| Key | Function |
|---|---|
← or h |
Adjust time backward by 15 minutes |
→ or l |
Adjust time forward by 15 minutes |
r |
Reset time to current |
Space |
Toggle play/pause |
Escape |
Close modal dialog |
Click the Share button to copy a URL with your current configuration. Send it to teammates to share your timezone setup instantly.
The TUI version reads from timezones.toml. Add new timezones like this:
[[timezones]]
name = "Singapore"
timezone = "Asia/Singapore"
work_hours = { start = "09:00", end = "18:00" }The Web version stores configuration in LocalStorage and supports URL sharing. Configuration is managed through the UI - no file editing required.
This tool uses the chrono-tz library and supports all IANA time zone identifiers:
Asia/Shanghai(China Beijing Time)America/New_York(US Eastern Time)Europe/London(UK London Time)Asia/Tokyo(Japan Tokyo Time)Australia/Sydney(Australia Sydney Time)Europe/Paris(France Paris Time)
Full list: IANA Time Zone Database
longtime/
├── crates/core/ # Shared business logic (config, time calculations)
├── bin/tui/ # Terminal UI application (ratatui)
├── bin/web/ # Web application (Leptos + Tailwind)
└── timezones.toml # TUI configuration file
| Library | Purpose |
|---|---|
| leptos | Reactive web framework (CSR mode) |
| ratatui | Terminal UI framework |
| chrono-tz | Timezone calculations |
| gloo-storage | LocalStorage for Web |
| tailwindcss v4 | CSS styling for Web |
A: Ensure timezones.toml is in the current directory and follows valid TOML syntax.
A: TUI: Restart the program. Web: Click the Reset button or press r.
A: Web version only: Click the Share button to copy a URL with your configuration encoded.
MIT