From: merch-redmine@... Date: 2019-06-21T17:48:34+00:00 Subject: [ruby-core:93303] [Ruby trunk Bug#14241] Time.strptime() doesn't support the directive "%W". Issue #14241 has been updated by jeremyevans0 (Jeremy Evans). Assignee set to akr (Akira Tanaka) Status changed from Open to Assigned File time-strptime-wnum.patch added I agree this is a bug that should be fixed. Attached is a patch that implements support for %U/%W/%u/%w in `Time#strptime`. ---------------------------------------- Bug #14241: Time.strptime() doesn't support the directive "%W". https://bugs.ruby-lang.org/issues/14241#change-78775 * 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) -- https://bugs.ruby-lang.org/ Unsubscribe: