时区计算器

考虑时差和夏令时,在国家与城市之间转换时间。

// about

工具介绍

选择源城市和目标城市,输入当地时间,即可查看对应的当地时间及其 UTC 偏移。

如何使用

  1. 选择原始时间所在的国家和城市。
  2. 选择目标地点并输入日期和时间。
  3. 点击“转换时间”即可查看目标时间和偏移量。

人们为何使用此工具

  • 无需心算时差即可安排国际会议。
  • 在操作系统提供相关规则时会考虑夏令时。
  • 显示对应的 UTC 时刻,方便团队核对转换结果。
指南 · 日期与时间 · 约 3 分钟

Unix 时间戳详解:秒与毫秒、时区和 2038 年问题

1700000000 是什么时候?为什么有些系统用 13 位数字?为什么时间恰好差了 8 个小时?弄懂几个概念,大部分时间相关的 bug 就会消失。

Unix 时间戳(Unix 时间、纪元时间)是一个整数,表示自 1970 年 1 月 1 日 00:00:00 UTC(即 Unix 纪元)以来经过的秒数。0 是 1970-01-01 00:00:00 UTC,1700000000 是 2023-11-14 22:13:20 UTC。

0           → 1970-01-01 00:00:00 UTC
1700000000  → 2023-11-14 22:13:20 UTC
1735689600  → 2025-01-01 00:00:00 UTC
2147483647  → 2038-01-19 03:14:07 UTC
什么是 Unix 时间戳、如何区分 10 位和 13 位数值、UTC 与本地时间的换算、夏令时陷阱以及 2038 年问题。
阅读指南 →
用 AI 自己做

用 AI 亲手打造这个工具

想要自己的版本?把下面的任务提示词粘贴到 AI 聊天中,或将技能文件保存到 AI 编程助手。其中包含我们开发此工具时整理的功能、边界情况和测试用例。

提示词和技能以英文提供,AI 工具在任何语言环境下都能很好地理解。

AI 任务提示词

直接粘贴到 Claude、ChatGPT、Gemini 等 AI 聊天中即可。

You are an experienced full-stack web developer. Build a web tool called "时区计算器" that meets the requirements below.

## Goal

Build a tool that shows a date and time from one zone in several other time zones.

## Core features

- Enter a base zone, date and time
- Add or remove cities (IANA zones)
- Show UTC offset and whether DST applies
- Highlight overlapping office hours (09–18)
- Copy the result table

## Inputs

- Base zone, date and time
- List of zones to compare

## Outputs

- Local date and time per zone
- Offset from the base zone

## Edge cases and handling rules

- Clearly mark date changes (+1 day, −1 day)
- Offset changes around DST start and end
- Half- and quarter-hour offsets (India, Nepal)
- Use IANA names rather than fixed offsets

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- 2026-01-15 09:00 Asia/Seoul → 2026-01-14 19:00 America/New_York
- 2026-07-15 09:00 Asia/Seoul → 2026-07-14 20:00 America/New_York
- Asia/Kolkata is +05:30

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

技能 (SKILL.md)

在 Claude Code 等 AI 编程助手中保存为 .claude/skills/build-timezone-calculator/SKILL.md,以后开发或修改此工具时可重复使用。

---
name: build-timezone-calculator
description: Use when building or changing a 时区计算器 tool. Build a tool that shows a date and time from one zone in several other time zones.
---

# Build: 时区计算器

## Goal

Build a tool that shows a date and time from one zone in several other time zones.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- Enter a base zone, date and time
- Add or remove cities (IANA zones)
- Show UTC offset and whether DST applies
- Highlight overlapping office hours (09–18)
- Copy the result table

## Inputs

- Base zone, date and time
- List of zones to compare

## Outputs

- Local date and time per zone
- Offset from the base zone

## Rules

- Clearly mark date changes (+1 day, −1 day)
- Offset changes around DST start and end
- Half- and quarter-hour offsets (India, Nepal)
- Use IANA names rather than fixed offsets
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] 2026-01-15 09:00 Asia/Seoul → 2026-01-14 19:00 America/New_York
- [ ] 2026-07-15 09:00 Asia/Seoul → 2026-07-14 20:00 America/New_York
- [ ] Asia/Kolkata is +05:30

交给 AI 时的小技巧

  • 在第一行写明技术栈(如 React、Vue 或纯 HTML),生成的代码会更贴合你的项目。
  • 在接受代码前,请让 AI 运行列出的测试用例并展示结果。
  • 不要把真实密码、客户数据或 API 密钥粘贴到提示词中,请用示例值代替。