Project

General

Profile

Bug #14241

Time.strptime() doesn't support the directive "%W".

Added by stsuboi (Sougo TSUBOI) over 2 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
[ruby-core:84478]

Description

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.patch jeremyevans0 (Jeremy Evans), 06/21/2019 05:47 PM
time-strptime-wnum-cw-14241.patch (3.2 KB) time-strptime-wnum-cw-14241.patch jeremyevans0 (Jeremy Evans), 08/11/2019 07:31 PM

Related issues

Related to Ruby master - Bug #9836: Bad Implementation of Time.strptimeClosedActions

Also available in: Atom PDF