Issue #15023 has been updated by nobu (Nobuyoshi Nakada).


`Time.at` supports `Rational` numbers too.

    puts Time.at(1486525793.995r).strftime("%s.%6N") #=> 1486525793.995000

----------------------------------------
Bug #15023: Time precision (in microsecond) inaccurate after performing strftime
https://bugs.ruby-lang.org/issues/15023#change-73693

* Author: calvinchso (Calvin So)
* Status: Rejected
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Please see the example below. I think we should expect the result to be "1486525793.995". Right?

OS version: MacOS High Sierra 10.13.6

Ruby version: 2.5.1

~~~ ruby
2.5.1 :005 > Time.at(1486525793.995).strftime("%s.%6N")
 => "1486525793.994999"
~~~




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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>