From: sawadatsuyoshi@... Date: 2014-09-16T11:42:40+00:00 Subject: [ruby-core:65062] [ruby-trunk - Feature #9794] DateTime.strptime() doesn't work correctly for '%s %z' Issue #9794 has been updated by Tsuyoshi Sawada. Eric Hodel wrote: > Felipe, your extreme rudeness has no place here. > > The rejection reason is described in #7445 as linked. > > Not every committer is proficient in English so Japanese is just fine. > > I don't suspect you'll get a reason. Eric, your speculation that Tadayoshi Funaba's comment was written in Japanese (only) because he may not be proficient in English is not correct. In the first comment written in Japanese in #7445, he wrote: > ��������������������������������������������������������������������������������� which translates to "My English doesn't seem to be understood by you, so I will write it in Japanese for you," which does not make sense at all if interpreted literally under the given situation. I interpret this as a very rude irony. It is Tadayoshi Funaba, who started all the rudeness. Felipe Contreras only responded rudely to a rude comment. I don't think there is anything wrong, generally, if a comment is written in any language. However, in this particular case, it was written in Japanese to give a certain (negative) effect. ---------------------------------------- Feature #9794: DateTime.strptime() doesn't work correctly for '%s %z' https://bugs.ruby-lang.org/issues/9794#change-48929 * Author: Felipe Contreras * Status: Closed * Priority: Low * Assignee: tadayoshi funaba * Category: ext * Target version: ---------------------------------------- Time.strptime() works correctly: Time.strptime('0 +0100', '%s %z').strftime('%s %z') => "0 +0100" But DateTime.strptime() doesn't: DateTime.strptime('0 +0100', '%s %z').strftime('%s %z') => "0 +0000" In Rubinious it does work correctly: DateTime.strptime('0 +0100', '%s %z').strftime('%s %z') => "0 +0100" This make the RubySL date space fail: DateTime#strptime parses seconds and timezone correctly FAILED Expected "1970-01-01T00:00:00+00:00" to equal "1970-01-01T01:00:00+01:00" In addition, both C and perl preserver the offset correctly when doing '%s %z'. So it's very clear DateTime.strptime() has to be fixed. Patch attached. ---Files-------------------------------- 0001-datetime-fix-strptime-s-z.patch (1.94 KB) -- https://bugs.ruby-lang.org/