时间戳转换

现在时间 2024年03月19日 17:16:55
UNIX时间戳 1710839815
开始 停止 刷新
输入标准时间或时间戳

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

2024-03-19
2024年03月19日
2024-03-19 17:16:55
2024年03月19日 17:16:55
2024年03月19日 17点16分55秒

只输入日期时,时分秒默认为00:00:00,例如“2024年03月19日”等同于“2024年03月19日 00:00:00”

不同编程语言获取时间戳

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())

站长工具类