时间戳转换工具

现在时间 2025-7-1 12:36:45
UNIX时间戳 1751344605
开始 停止 刷新
输入标准时间或时间戳

时间戳转换工具支持的时间格式

2025-07-01
2025年7月01日
2025-07-01 12:36:45
2025年7月01日 12:36:45
2025年7月01日 12点36分45秒

只输入日期时,时分秒默认为00:00:00,例如“2025年7月01日”等同于“2025年7月01日 12:36:45”

不同编程语言获取时间戳

Java时间戳 time

PHP时间戳 time()

MySQL时间戳 SELECT unix_timestamp(now())

JS时间戳 Math.round(new Date().getTime()/1000) getTime() 返回的单位是毫秒

iOS时间戳 [[NSDate date] timeIntervalSince1970] 小数部分是毫秒微秒

Python时间戳 先 import time 然后 time.time()

Ruby时间戳 获取Unix时间戳:Time.now 或 Time.new ,显示Unix时间戳:Time.now.to_i

SQL Server时间戳 SELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE())

PostgreSQL时间戳 SELECT extract(epoch FROM now())

Unix时间戳/Linux时间戳 date +%s

Microsoft .NET/C# epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000

VBScript/ASP时间戳 DateDiff("s", "01/01/1970 00:00:00", Now())

站长工具类查询