From: julien.bake@... Date: 2018-01-05T16:03:07+00:00 Subject: [ruby-core:84649] [Ruby trunk Bug#14317] Date.strptime(..., "%U") fails if first day of the week is not in the 0th week. Issue #14317 has been reported by jbake (Julien Bake). ---------------------------------------- Bug #14317: Date.strptime(..., "%U") fails if first day of the week is not in the 0th week. https://bugs.ruby-lang.org/issues/14317 * Author: jbake (Julien Bake) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- Date.new(2018,1,1) => Mon, 01 Jan 2018 Date.new(2018,1,1).strftime("%U %Y") => "00 2018" Date.strptime("00 2018", "%U %Y") ArgumentError: invalid date Date.strptime("1 0 2018", "%u %U %Y") => Mon, 01 Jan 2018 i would expect to get the first valid date that is in the 0th week (1.1.2018) from Date.strptime("00 2018", "%U %Y") even if the first day (sunday) of the 0th week is not existing / in the last year. -- https://bugs.ruby-lang.org/ Unsubscribe: