1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/date/date_parse.c (date_zone_to_diff): [ruby-core:55831].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2013-07-09 21:24:35 +00:00
parent 07dc825703
commit dafbdd6816
3 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Wed Jul 10 06:22:27 2013 Tadayoshi Funaba <tadf@dotrb.org>
* ext/date/date_parse.c (date_zone_to_diff): [ruby-core:55831].
Wed Jul 10 00:41:42 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (bary_mul): x*1 is x.

View file

@ -569,7 +569,7 @@ date_zone_to_diff(VALUE str)
if (cl >= 3)
min = rb_str_new(&cs[1], 2);
if (cl >= 5)
min = rb_str_new(&cs[3], 2);
sec = rb_str_new(&cs[3], 2);
}
else {
if (cl >= 2)

View file

@ -578,6 +578,15 @@ class TestDateParse < Test::Unit::TestCase
assert_equal(d2, d1)
end
def test__parse_odd_offset
h = DateTime._parse('2001-02-03T04:05:06+1')
assert_equal(3600, h[:offset])
h = DateTime._parse('2001-02-03T04:05:06+123')
assert_equal(4980, h[:offset])
h = DateTime._parse('2001-02-03T04:05:06+12345')
assert_equal(5025, h[:offset])
end
require 'time'
def test_parse__time