您的位置:首页 > 其它

开发语言的时间戳(timestamp)

2015-03-25 17:38 141 查看
总结下一些语言的时间戳---Timestamp有的语言的时间戳的单位是毫秒,1秒 == 1000毫秒。so,以下是毫秒的都转换成秒了。
还有其他语言,欢迎大家补充!
语言时间戳(单位:秒)
SwiftNSDate().timeIntervalSince1970
Goimport ( "time")int32(time.Now().Unix())
Java (int) (System.currentTimeMillis() / 1000)
JavaScriptMath.round(new Date() / 1000)
Objective-C[[NSDate date] timeIntervalSince1970]
MySQL SELECT unix_timestamp(now())
SQLite SELECT strftime('%s', 'now')
Erlang calendar:datetime_to_gregorian_seconds(calendar:universal_time())-719528*24*3600.
PHP time()
Python import timetime.time()
RubyTime.now.to_i
Shelldate +%s
本文出自 “51action” 博客,请务必保留此出处http://51action.blog.51cto.com/5470351/1624316
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: