From: matz@... Date: 2014-05-13T23:40:20+00:00 Subject: [ruby-core:62568] [ruby-trunk - Bug #9836] [Feedback] Bad Implementation of Time.strptime Issue #9836 has been updated by Yukihiro Matsumoto. Status changed from Open to Feedback I am not sure what behavior you are referring as "extremely naive". Please be concrete. How do you think it should behave? Matz. ---------------------------------------- Bug #9836: Bad Implementation of Time.strptime https://bugs.ruby-lang.org/issues/9836#change-46714 * Author: Max Anselm * Status: Feedback * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- According to the documentation, `Time.strptime` "parses +date+ using `Date._strptime` and converts it to a Time object." However this conversion is extremely naive, using only certain fields return by `Date._strptime` and ignoring the rest (for example `:wnum0`). This creates confusing and inconsistent behavior when compared to `Date` and `DateTime`'s `strptime` methods. For example: ``` puts Date.strptime('201418', "%Y%U") => 2014-05-04 puts DateTime.strptime('201418', "%Y%U") => 2014-05-04T00:00:00+00:00 puts Time.strptime('201418', "%Y%U") => 2014-01-01 00:00:00 -0500 ``` -- https://bugs.ruby-lang.org/