时间戳转换 #转换

当前时间戳
时间戳
当前时间
时间
时间戳(秒)
时间戳(毫秒)
ISO 8601
日期时间(UTC)
日期时间(本地)

关于

Unix时间戳

从1970年1月1日(UTC/GMT的午夜)开始所经过的秒数,不考虑闰秒。

英文为 Unix epoch, Unix time, POSIX time 或 Unix timestamp

获取时间戳

Swift NSDate().timeIntervalSince1970
Go import ( "time" )
int32(time.Now().Unix())
Java (int) (System.currentTimeMillis() / 1000)
JavaScript Math.round(new Date() / 1000)
Objective-C [[NSDate date] timeIntervalSince1970]
MySQL SELECT unix_timestamp(now())
SQLite SELECT strftime('%s', 'now')
PHP time()
Python import time
time.time()
Ruby Time.now.to_i
Shell date +%s
Groovy (new Date().time / 1000).intValue()
Lua os.time()
.NET/C# (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000