← 返回 Skill 列表
extension
分类: 开发与工程API Key 暂未确认

timezone-tools

获取任意时区的当前时间,并在不同时区之间转换时间。在处理时间、日期、时区、跨区域调度,或用户提及特定城市/地区的时间查询时使用。支持IANA时区名称。

person作者: jakexiaohubgithub

Timezone Tools

Three standard-library Python scripts (3.9+, zoneinfo) over the IANA timezone database. Nothing to install on macOS or Linux.

Steps

  1. Resolve each place to an IANA name (America/New_York, not EST). If unsure, search:

    python3 "${CLAUDE_SKILL_DIR}/scripts/list_timezones.py" "perth"
    

    Done when every place in the question maps to one IANA name. data/common_timezones.json lists major cities.

  2. Current time ("what time is it in Tokyo?"):

    python3 "${CLAUDE_SKILL_DIR}/scripts/get_time.py" "Asia/Tokyo"
    

    Prints timezone, ISO datetime, weekday and DST status.

  3. Conversion ("2pm New York in Perth?"): source zone, 24-hour HH:MM, target zone, then an optional YYYY-MM-DD date of the source time:

    python3 "${CLAUDE_SKILL_DIR}/scripts/convert_time.py" "America/New_York" "14:00" "Australia/Perth" 2026-11-02
    

    Without the date the time is taken as today in the source zone. Pass the date whenever the question is about a specific day - offsets change at DST boundaries, so today's offset can be wrong for next week's meeting. Prints source and target datetimes with weekday, DST status, and the difference in hours.

    On a DST changeover day the script adds a Warning: line: a skipped time (clocks forward) is shifted to the real time it lands on, and a repeated time (clocks back) shows both readings and uses the first. Pass that warning on to the user.

Done when the answer quotes the script's output time, including the weekday if it crosses midnight.

Example

python3 "${CLAUDE_SKILL_DIR}/scripts/convert_time.py" "America/New_York" "14:00" "Australia/Perth" 2026-11-02
# Source: America/New_York - 2026-11-02T14:00:00-05:00 (Monday, DST: No)
# Target: Australia/Perth - 2026-11-03T03:00:00+08:00 (Tuesday, DST: No)
# Time difference: +13.0h

Troubleshooting

  • "Invalid timezone" - use an IANA name; search with list_timezones.py. On Windows, which ships no IANA database, zoneinfo needs the tzdata package: run the scripts as uv run --with tzdata python ....
  • "Invalid time format" - 24-hour HH:MM: 14:30, not 2:30 PM.
  • "Invalid date format" - YYYY-MM-DD.