在线免费Unix时间戳转换器
将Unix时间戳转换为可读的日期时间,反之亦然。
Who uses the Unix时间戳转换器?
- 开发者调试包含原始Unix时间戳的日志文件和API响应。
- 数据库工程师为报表查询将纪元时间戳转换为可读格式。
- DevOps工程师根据服务器日志验证定时任务和cron作业的执行时间。
How the Unix时间戳转换器 works
Timestamp → Date:以秒为单位输入Unix时间戳(例如1700000000)并点击Convert,或点击 Use Now 获取当前时间戳——结果同时显示UTC时间和你浏览器的本地时间。
Date → Timestamp:切换标签页,使用浏览器本地的日期时间选择器选择日期和时间,然后点击Convert——结果同时以秒和毫秒显示时间戳。
没有单独的毫秒或纳秒输入控件——输入只接受秒。
没有时区选择器——“本地时间”始终反映你浏览器自身系统的时区,而不是你选择的时区。
Tips & tricks
- 时间戳输入框只接受秒——不要粘贴毫秒时间戳(13位数字)并期望得到正确结果;先除以1000。
- 没有时区选择器——“Local Time”结果始终使用你自己浏览器/设备的时区,而不是你选择的时区。
- Date → Timestamp 模式的输出同时提供秒和毫秒,尽管输入只能是秒。
- “Use Now”会立即填充时间戳字段并进行转换,便于快速获取当前的纪元时间。
Frequently Asked Questions
现在的Unix时间戳是多少?
打开该工具,进入“Timestamp → Date”标签页,点击“Use Now”即可查看当前的Unix时间戳(以秒为单位)。在JavaScript中,你也可以用 Math.floor(Date.now()/1000) 获取。
什么是Unix纪元(epoch)?
Unix纪元是1970年1月1日00:00:00 UTC——所有Unix时间戳都以此为起点计算。1970年之前的时间戳为负数。选择这个纪元是因为它在计算机历史上是一个整数年份。
我可以输入以毫秒或纳秒为单位的时间戳吗?
不可以——时间戳输入框只接受秒。将日期转换为时间戳时,该工具确实会同时显示秒和毫秒的结果,但没有毫秒/纳秒输入模式或开关。
我可以选择以哪个时区显示可读日期吗?
不能直接选择——该工具显示UTC时间和你浏览器自身的本地时间(基于你系统的时区设置),但没有下拉菜单可以选择任意时区来显示。
Unix时间戳的最大值是多少(2038年问题)?
使用32位有符号整数的系统会在2,147,483,647(Unix时间)时达到最大值,即2038年1月19日。64位系统将其扩展到公元292,277,026,596年——实际上是无限的。现代系统已经使用64位时间戳。
Is my data safe when using the Unix时间戳转换器?
Completely safe. The Unix时间戳转换器 processes everything locally in your browser. No input data, results, or usage information is ever transmitted to or stored on any server.
Does the Unix时间戳转换器 automatically account for daylight saving time?
Yes. The Unix时间戳转换器 uses your browser's built-in time zone data, which includes daylight saving time rules for all supported time zones, keeping results accurate year-round.
How does the Unix时间戳转换器 handle daylight saving time and leap years?
The Unix时间戳转换器 uses your browser's built-in Intl and Date APIs, which automatically account for daylight saving time transitions, leap years, and regional time zone rules. You do not need to make any manual adjustments for these calendar events.