Project

General

Profile

Feature #10544

Updated by nobu (Nobuyoshi Nakada) about 5 years ago

Currently, we have to take an indirect way to get unix_time in milliseconds.

~~~ruby
time = Time.now
milliseconds = (time.to_i * 1000) + (time.usec / 1000.0).round
~~~


I think it would be convenient if `Time#to_i` Time#to_i accepts unit parameter like following.

~~~ruby
time = Time.now
milliseconds = time.to_i(:millisecond)
~~~

Back