时间戳转换
现在时间:
当前时间戳:毫秒
时间戳转时间:
时间转时间戳:
获取当前时间戳
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]
PHP: time()
MySQL: SELECT unix_timestamp(now())
SQLite: SELECT strftime('%s', 'now')
Python: import time
time.time()
Ruby: Time.now.to_i
Shell: date +%s
Lua: os.time()
C#: (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000