| Crates.io | longtime |
| lib.rs | longtime |
| version | 0.1.0 |
| created_at | 2025-04-30 03:41:01.887431+00 |
| updated_at | 2025-04-30 03:41:01.887431+00 |
| description | Multi-timezone Time Management Tool with TUI interface |
| homepage | |
| repository | https://github.com/akjong/longtime |
| max_upload_size | |
| id | 1654413 |
| size | 69,489 |
Multi-timezone Time Management Tool
A command-line terminal user interface (TUI) tool developed with Rust and ratatui library for managing and displaying time information across multiple time zones.
Chinese version: README_zh
cargo build --release
cargo run --release
Or directly run the compiled binary:
./target/release/time
The program uses a timezones.toml configuration file to define time zone information. This file should be placed in the current directory where the program is executed.
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, including start (start time) and end (end time)After starting the program, you'll see a list containing information for all configured time zones. Each time zone entry displays:
| Key | Function |
|---|---|
↑ (Up Arrow) |
Select previous time zone |
↓ (Down Arrow) |
Select next time zone |
← (Left Arrow) |
Adjust time backward by 15 minutes |
→ (Right Arrow) |
Adjust time forward by 15 minutes |
q |
Exit program |
When you adjust time using the left and right arrow keys, time in all time zones updates synchronously. This feature allows you to:
To add a new time zone, simply add a new [[timezones]] entry in the timezones.toml file:
[[timezones]]
name = "Singapore"
timezone = "Asia/Singapore"
work_hours = { start = "09:00", end = "18:00" }
To modify the work hours of an existing time zone, update the work_hours value for the corresponding time zone entry:
[[timezones]]
name = "London"
timezone = "Europe/London"
work_hours = { start = "08:30", end = "16:30" } # Updated work hours
This tool uses the chrono-tz library and supports all time zone identifiers in the IANA time zone database. Common time zone identifiers include:
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)A complete list of time zones can be found here.
This tool uses the following Rust libraries:
A: Ensure the timezones.toml file is in the current directory where the program is executed and follows the correct TOML syntax format.
A: Exit the program and restart to reset the time offset.
A: Currently, the time adjustment step is fixed at 15 minutes. If you need to modify it, you can edit the adjust_time_forward and adjust_time_backward functions in the source code.