Project

General

Profile

Actions

Feature #10544

closed

Time#to_i(:millisecond)

Added by Glass_saga (Masaki Matsushita) over 9 years ago. Updated over 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:66466]

Description

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

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

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

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

Files

patch.diff (2.71 KB) patch.diff Time#to_i(:millisecond) implementation Glass_saga (Masaki Matsushita), 11/26/2014 01:46 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0