summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/time.rb2
-rw-r--r--test/test_time.rb2
-rw-r--r--version.h2
3 files changed, 4 insertions, 2 deletions
diff --git a/lib/time.rb b/lib/time.rb
index 5179e9fee4..0af919b9b8 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -575,7 +575,7 @@ class Time
T
(\d\d):(\d\d):(\d\d)
(\.\d+)?
- (Z|[+-]\d\d:\d\d)?
+ (Z|[+-]\d\d(?::?\d\d)?)?
\s*\z/ix =~ date
year = $1.to_i
mon = $2.to_i
diff --git a/test/test_time.rb b/test/test_time.rb
index 398ab7279b..e33c1f0153 100644
--- a/test/test_time.rb
+++ b/test/test_time.rb
@@ -105,6 +105,8 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
t = Time.utc(1996, 12, 20, 0, 39, 57)
s = "1996-12-19T16:39:57-08:00"
assert_equal(t, Time.__send__(method, s))
+ assert_equal(t, Time.__send__(method, s.sub(/:(?=00\z)/, '')))
+ assert_equal(t, Time.__send__(method, s.sub(/:00\z/, '')))
# There is no way to generate time string with arbitrary timezone.
s = "1996-12-20T00:39:57Z"
assert_equal(t, Time.__send__(method, s))
diff --git a/version.h b/version.h
index a13c7a9094..2787b4e308 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.4.5"
#define RUBY_RELEASE_DATE "2018-07-31"
-#define RUBY_PATCHLEVEL 313
+#define RUBY_PATCHLEVEL 314
#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 7