开发者

How do I work out the difference between the current UTC time and a constant other UTC time?

开发者 https://www.devze.com 2023-03-24 09:03 出处:网络
How can I work out how many hours and minutes are between the current UTC time and the next time that it is 0021/12:21am in the UTC timezone?

How can I work out how many hours and minutes are between the current UTC time and the next time that it is 0021/12:21am in the UTC timezone?

For example, if the current UTC time is 2000/8:00pm, the answer would be 4 hours and 21 minutes. If the current UTC time is 0003/12:03am, the answer would be 0 开发者_开发问答hours and 18 minutes.

I'm using Ruby 1.9.2 and Rails 3.0.1


see

http://www.ruby-doc.org/core/classes/Time.src/M000358.html
http://www.ruby-doc.org/core/classes/Time.html#M000334

IF I understand this correctly the difference is represented as float which in turn contains how many seconds...

0

精彩评论

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