Project

General

Profile

Actions

Bug #14241

closed

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

Added by stsuboi (Sougo TSUBOI) almost 7 years ago. Updated about 5 years ago.

Status:
Closed
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 1 (0 open1 closed)

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0