[ruby-core:66466] [ruby-trunk - Feature #10544] [Open] Time#to_i(:millisecond)

From: glass.saga@...
Date: 2014-11-26 01:47:20 UTC
List: ruby-core #66466
Issue #10544 has been reported by Masaki Matsushita.

----------------------------------------
Feature #10544: Time#to_i(:millisecond)
https://bugs.ruby-lang.org/issues/10544

* Author: Masaki Matsushita
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: next minor
----------------------------------------
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)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next