时间戳转换
Unix 时间戳与日期时间相互转换
当前时间戳
Unix 时间戳 (秒)
1772272847
Unix 时间戳 (毫秒)
1772272847821
本地时间:2026/2/28 10:00:47
时间戳转日期
本地时间 (Local)
等待输入...
格林威治时间 (UTC)
等待输入...
日期转时间戳
Unix 时间戳 (秒)
---
Unix 时间戳 (毫秒)
---
单位换算
1 分钟60 秒
1 小时3,600 秒
1 天86,400 秒
1 周604,800 秒
1 个月 (30.44天)2,629,743 秒
1 年 (365.24天)31,556,926 秒
常见语言
JavaScript
Math.floor(Date.now() / 1000)Python
import time; int(time.time())Java
System.currentTimeMillis() / 1000PHP
time()Go
time.Now().Unix()Shell
date +%sC++
std::time(nullptr)Rust
SystemTime::now().duration_since(UNIX_EPOCH).as_secs()