Forum: Ruby-core [ruby-trunk - Bug #6835][Open] Rdoc for DateTime#strftime('%Q') says 'microseconds' instead if 'mill

Posted by stomar (Marcus Stollsteimer) (Guest)
on 2012-08-04 16:34
(Received via mailing list)
Issue #6835 has been reported by stomar (Marcus Stollsteimer).

----------------------------------------
Bug #6835: Rdoc for DateTime#strftime('%Q') says 'microseconds' instead 
if 'milliseconds'
https://bugs.ruby-lang.org/issues/6835

Author: stomar (Marcus Stollsteimer)
Status: Open
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version:
ruby -v: 1.9.3


=begin
The patch fixes wrong rdoc for %Q, which returns the number of 
((*milli*))seconds since the unix epoch, not ((*micro*))seconds.

(This is also the expected behavior according to the tests in 
test/date/test_date_strftime.rb)

This affects also Ruby 1.8.

 1.9.3p194 :001 > require 'date'
 1.9.3p194 :002 > d = DateTime.parse('1970-01-01T00:00:05.123456+00:00')
 => #<DateTime: 1970-01-01T00:00:05+00:00 
((2440588j,5s,123456000n),+0s,2299161j)>
 1.9.3p194 :003 > d.strftime('%s')
 => "5"
 1.9.3p194 :004 > d.strftime('%Q')
 => "5123"
=end
Posted by tadf (tadayoshi funaba) (Guest)
on 2012-08-04 23:54
(Received via mailing list)
Issue #6835 has been updated by tadf (tadayoshi funaba).

Status changed from Open to Assigned
Assignee changed from drbrain (Eric Hodel) to tadf (tadayoshi funaba)


----------------------------------------
Bug #6835: Rdoc for DateTime#strftime('%Q') says 'microseconds' instead 
if 'milliseconds'
https://bugs.ruby-lang.org/issues/6835#change-28651

Author: stomar (Marcus Stollsteimer)
Status: Assigned
Priority: Normal
Assignee: tadf (tadayoshi funaba)
Category: DOC
Target version:
ruby -v: 1.9.3


=begin
The patch fixes wrong rdoc for %Q, which returns the number of 
((*milli*))seconds since the unix epoch, not ((*micro*))seconds.

(This is also the expected behavior according to the tests in 
test/date/test_date_strftime.rb)

This affects also Ruby 1.8.

 1.9.3p194 :001 > require 'date'
 1.9.3p194 :002 > d = DateTime.parse('1970-01-01T00:00:05.123456+00:00')
 => #<DateTime: 1970-01-01T00:00:05+00:00 
((2440588j,5s,123456000n),+0s,2299161j)>
 1.9.3p194 :003 > d.strftime('%s')
 => "5"
 1.9.3p194 :004 > d.strftime('%Q')
 => "5123"
=end
Posted by tadf (tadayoshi funaba) (Guest)
on 2012-08-05 00:09
(Received via mailing list)
Issue #6835 has been updated by tadf (tadayoshi funaba).

Status changed from Assigned to Closed


----------------------------------------
Bug #6835: Rdoc for DateTime#strftime('%Q') says 'microseconds' instead 
if 'milliseconds'
https://bugs.ruby-lang.org/issues/6835#change-28652

Author: stomar (Marcus Stollsteimer)
Status: Closed
Priority: Normal
Assignee: tadf (tadayoshi funaba)
Category: DOC
Target version:
ruby -v: 1.9.3


=begin
The patch fixes wrong rdoc for %Q, which returns the number of 
((*milli*))seconds since the unix epoch, not ((*micro*))seconds.

(This is also the expected behavior according to the tests in 
test/date/test_date_strftime.rb)

This affects also Ruby 1.8.

 1.9.3p194 :001 > require 'date'
 1.9.3p194 :002 > d = DateTime.parse('1970-01-01T00:00:05.123456+00:00')
 => #<DateTime: 1970-01-01T00:00:05+00:00 
((2440588j,5s,123456000n),+0s,2299161j)>
 1.9.3p194 :003 > d.strftime('%s')
 => "5"
 1.9.3p194 :004 > d.strftime('%Q')
 => "5123"
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.