开发工具/时间戳转换器
时间戳转换器
在Unix时间戳和可读日期之间转换
当前时间
Unix时间戳 (秒)
-
Unix时间戳 (毫秒)
-
ISO 8601
-
本地时间
-
时间戳 → 日期和时间
日期和时间 → 时间戳
Timestamp Converter Guide
Learn how to work with Unix timestamps and dates
What is a Unix Timestamp?
A Unix timestamp is the number of seconds that have elapsed since January 1, 1970 (UTC), known as the Unix epoch. It provides a universal way to represent dates and times across different systems and time zones.
How to Use This Tool
- View the current time in multiple formats at the top
- Enter a Unix timestamp to convert it to a human-readable date
- Or select a date/time to get its Unix timestamp
- Copy values using the copy buttons
Pro Tips
- JavaScript uses millisecond timestamps - multiply by 1000 or divide by 1000 as needed
- ISO 8601 format is ideal for APIs and international applications
- Click 'Now' to get the current timestamp instantly
Browser Support
Date parsing and formatting is supported in all modern browsers. Times are displayed in your local timezone.
常见问题
Unix时间戳是什么?
Unix时间戳是自1970年1月1日00:00:00 UTC(称为Unix纪元)以来经过的秒数。它是一种跨平台、跨时区的标准时间表示方式。例如,1705315200代表2024年1月15日12:00:00 UTC。
为什么JavaScript使用毫秒时间戳?
JavaScript的Date.getTime()返回毫秒(千分之一秒),而标准Unix时间戳是秒。毫秒提供更高的精度。转换时需要乘以1000(秒转毫秒)或除以1000(毫秒转秒)。
2038年问题是什么?
32位系统将Unix时间戳存储为有符号整数,最大值约21.47亿,对应2038年1月19日03:14:07 UTC。超过此时间会溢出变成负数。现代64位系统不受影响,可表示约2920亿年。
如何处理不同时区的时间?
Unix时间戳本身不包含时区信息,总是表示UTC时间。转换为本地时间时需要考虑时区偏移。建议:存储和传输使用UTC/时间戳,仅在显示给用户时转换为本地时间。ISO 8601格式可以包含时区信息。
ISO 8601日期格式是什么?
ISO 8601是国际标准日期时间格式:YYYY-MM-DDTHH:mm:ss.sssZ。T分隔日期和时间,Z表示UTC时区,也可用+/-HH:mm表示时区偏移。例如:2024-01-15T10:30:00+08:00(北京时间)。它是API和数据交换的推荐格式。