From: Shugo Maeda Date: 2010-03-11T14:01:45+09:00 Subject: [ruby-core:28603] [Bug #2952] Time.strftime format %N Issue #2952 has been updated by Shugo Maeda. > There seems to be some rouding errors with the %N formatter for Time->strftime > t1 = 1236922275.8516 > t2 = Time.at(t1) It is because a Float can't represent 1236922275.8516 exactly, isn't it? The following script prints "1236922275.851600". $ cat t.rb t = Time.at(1236922275, 851600) puts t.strftime("%s.%6N") $ ruby-trunk -v t.rb ruby 1.9.2dev (2010-03-10 trunk 26866) [i686-linux] 1236922275.851600 ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2952 ---------------------------------------- http://redmine.ruby-lang.org