Issue #14241 has been updated by jeremyevans0 (Jeremy Evans).

File time-strptime-wnum-cw-14241.patch added

Here's an updated patch that handles `%V`, `%g`, and `%G` as well.

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

* Author: stsuboi (Sougo TSUBOI)
* Status: Assigned
* Priority: Normal
* Assignee: akr (Akira Tanaka)
* 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):003:0> Time.strptime("2017 1", "%Y %W").strftime("%F")
=> "2017-01-01"
irb(main):004:0> Date.strptime("2017 1", "%Y %W").strftime("%F")
=> "2017-01-02"



---Files--------------------------------
time-strptime-wnum.patch (1.89 KB)
time-strptime-wnum-cw-14241.patch (3.2 KB)


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

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