Skip to content

Commit 2e0a4cc

Browse files
committed
Try Time.new(string, in: 0) for parsing.
1 parent 70de71c commit 2e0a4cc

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lib/db/postgres/native/types.rb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,7 @@ def parse(string)
8888
return string
8989
end
9090

91-
if match = string.match(/\A(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+(?:\.\d+)?)([-+]\d\d(?::\d\d)?)?\z/)
92-
parts = match.captures
93-
94-
parts[5] = Rational(parts[5])
95-
96-
if parts[6].nil?
97-
parts[6] = '+00'
98-
end
99-
100-
return Time.new(*parts)
101-
end
91+
return Time.new(string, in: 0)
10292
end
10393
end
10494

0 commit comments

Comments
 (0)