[ruby-core:84478] [Ruby trunk Bug#14241] Time.strptime() doesn't support the directive "%W" in .

From: stsuboi@...
Date: 2017-12-26 10:10:15 UTC
List: ruby-core #84478
Issue #14241 has been reported by stsuboi (Sougo TSUBOI).

----------------------------------------
Bug #14241: Time.strptime() doesn't support the directive "%W" in .
https://bugs.ruby-lang.org/issues/14241

* Author: stsuboi (Sougo TSUBOI)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
According to reference manual, Time.strptime() accepts the directive "%W" in a format string, but it seems not to be worked.
On the other hand, Date.strptime() accepts "%W" correctly.

C:\>ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]

C:\>irb
irb(main):001:0> require "time"
=> true
irb(main):002:0> Time.strptime("2017 1", "%Y %W")
=> 2017-01-01 00:00:00 +0900
irb(main):004:0> Date.strptime("2017 1", "%Y %W")
=> #<Date: 2017-01-02 ((2457756j,0s,0n),+0s,2299161j)>





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

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

In This Thread

Prev Next