Project

General

Profile

Actions

Bug #6282

closed

strptime and fractions of seconds

Added by lparra (Luis Parravicini) about 12 years ago. Updated almost 6 years ago.

Status:
Rejected
Target version:
-
[ruby-core:44291]

Description

=begin
DateTime::strptime refers us to #strftime to check the format to use.
DateTime#strftime says fractions of seconds can be specified with %N, %3N, %6N, %9N and %12N but strptime only recognizes %N.

d = DateTime.strptime("1:2:3.123", '%H:%M:%S.%3N')
ArgumentError: invalid date

And this works:

d = DateTime.strptime("1:2:3.1234567901234567890", '%H:%M:%S.%N')
d.sec_fraction
=> (123456790123456789/1000000000000000000)

I don't know whether it's a bug or the intended functionality but shouldn't it say somewhere in the documentation about this?

=end


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #11220: strptime(%6N)RejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0