Actions
Feature #10544
closedTime#to_i(:millisecond)
Feature #10544:
Time#to_i(:millisecond)
Status:
Rejected
Assignee:
-
Target version:
-
Description
Files
Actions
Added by Glass_saga (Masaki Matsushita) over 11 years ago. Updated almost 10 years ago.
Description
Files
| patch.diff (2.71 KB) patch.diff | Time#to_i(:millisecond) implementation | Glass_saga (Masaki Matsushita), 11/26/2014 01:46 AM |
Do you need unix time in milliseconds so often?
I want this feature to give unix time to other languages like JavaScript.
Some languages expect unix time in milliseconds.
How about a more general Time#to_i(scale=1)?
Examples:
1 for scale (or passing nothing) would return seconds.1000 for scale would return milliseconds.1/60r for scale would return minutes.Masaki Matsushita wrote:
IMHO, it is generally preferable to avoid time travel by truncating to the beginning of the "present" millisecond rather than possibly rounding to the beginning of the "future" millisecond.