开发者

How to parse time saved in milli/micro seconds as integer in ruby?

开发者 https://www.devze.com 2023-02-09 13:53 出处:网络
I\'m generating and storing time in milliseconds as follow : (Time.now.to_f * 1000).t开发者_JS百科o_i # => 1297073972278

I'm generating and storing time in milliseconds as follow :

(Time.now.to_f * 1000).t开发者_JS百科o_i # => 1297073972278

How can I parse nicely this number to get the time object back?


Time.at 1297073972278 / 1000
=> Mon Feb 07 11:19:32 +0100 2011
0

精彩评论

暂无评论...
验证码 换一张
取 消