Project

General

Profile

Bug #15322

Updated by okkez (okkez _) over 5 years ago

~~~ 
 Time.strptime("2018-11-20 Time.parse("2018-11-20 17:11:22.123", "%Y-%m-%d %H:%M:%S.%3N") 
 # => raise ArgumentError: invalid strptime format - `%Y-%m-%d %H:%M:%S.%3N' 
 Time.strptime("2018-11-20 Time.parse("2018-11-20 17:11:22.123456", "%Y-%m-%d %H:%M:%S.%6N") 
 # => raise ArgumentError: invalid strptime format - `%Y-%m-%d %H:%M:%S.%6N' 
 Time.strptime("2018-11-20 Time.parse("2018-11-20 17:11:22.123456789", "%Y-%m-%d %H:%M:%S.%9N") 
 # => raise ArgumentError: invalid strptime format - `%Y-%m-%d %H:%M:%S.%9N' 
 ~~~ 

 But RDoc says that (https://docs.ruby-lang.org/en/2.5.0/Time.html#method-c-strptime): 

 ~~~ 
 %N 
 Fractional seconds digits, default is 9 digits (nanosecond) 

   %3N 
   millisecond (3 digits) 

   %6N 
   microsecond (6 digits) 

   %9N 
   nanosecond (9 digits) 
 ~~~ 

 `%N` works fine for this purpose. 
 I think we can remove %3N, %6N, and %9N from the document. 

 In fact, Fluentd users confuse when they read [the document](https://docs.ruby-lang.org/en/2.5.0/Time.html#method-c-strptime) to configure Fluentd's parameter. 


 See also #11220

Back