Project

General

Profile

Bug #14241

Updated by stsuboi (Sougo TSUBOI) over 1 year ago

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: &#35;<Date: 2017-01-02 ((2457756j,0s,0n),+0s,2299161j)>

Back