Unix 时代戳转换器
在 Unix 时代时间戳和人类日期和时间之间的转换。
输入结果时更新 。
关于此计算器
A Unix timestamp is the number of seconds since 1 January 1970 UTC (the "epoch"). This converter turns an epoch timestamp into a readable UTC and local date, or takes a date and time and returns its epoch value. It handles both seconds and milliseconds, shows the ISO 8601 form, and names the weekday. A staple for developers reading logs, databases and API responses.
Pick a direction: give it an epoch number and it shows that exact instant both in UTC and in your browser’s local time zone (the two lines differ by your UTC offset), plus the ISO 8601 string and the weekday. Give it a date and a local time instead and it returns the matching epoch value. Because seconds-based timestamps and the millisecond timestamps used by JavaScript differ by a factor of 1,000, a unit switch lets you read or produce either.
For example, the timestamp 1700000000 is Tuesday 14 November 2023 22:13:20 UTC; the ten-digit length is a clue it is in seconds, whereas a thirteen-digit value like 1700000000000 is the same instant in milliseconds. Developers use this to decode a created_at column, sanity-check an API response, set an expiry, or convert a log line’s epoch stamp into a human date.
经常问到的问题
unix 时间戳是秒还是毫秒?
经典 Unix 时间戳是1970年代后几秒开始的, 但 JavaScript 和许多 API 使用毫秒(1 000x 以上) 。 在高级选项下设置该单位, 以两种方式读取一个值 。
时间戳代表什么时区?
Unix 时间戳没有时区, 是一个绝对瞬间。 该工具显示, 当UTC 和浏览器的本地时间同时, 这两行会因您的 UTC 抵消而有所不同 。
我怎么知道时间戳是秒还是毫秒?
数数字: 现日秒时间戳长度约为 10 位数, 毫克秒的长度约为 13 位数。 如果一个解码日期在 1970 年 附近, 您可能会读取 毫秒 值 。
什么是Unix时代?
时代是Unix时间的零点: 1970年1月1日午夜时值。 每一个时间戳都只是从当时数的秒数( 或毫秒数 ) 。
它能将日期转换成时间戳吗?
是。 切换方向到日期 度时戳, 输入日期和本地时间, 返回时代值, 这样您就可以向任一方向绕行 。
2038年的问题是什么?
2038年1月19日将Unix时间存储在签名的32位整数溢出中的系统, 之后计算将无法再增加。 现代64位时标将避免这种情况, 而这个转换器处理的日期远超过2038年。
API - 使用代码中的计算器
将此计算器称为自由 JSON 端点 。 不需要按键 。 将字段值发送到下面作为查询参数或 JSON 。 任何您省略的, 都会使用相同的默认值, 此页面预填的默认值是预填的; 未知参数是 400, 而不是静音零 。 读取 API 全部文件 →
终点
GET https://calculator.free/api/v1/unix-timestamp/
curl
curl "https://calculator.free/api/v1/unix-timestamp/?mode=to_date&unix=1700000000&date=2026-09-08"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/unix-timestamp/?" + new URLSearchParams({
"mode": "to_date",
"unix": "1700000000",
"date": "2026-09-08"
}));
const data = await r.json();
console.log(data.results);
成果仅是一般指导的估计数,而不是财务、医疗或税务咨询。