From 451f794d1fa77b8e96e0a2f37f7fdd04740bdfc5 Mon Sep 17 00:00:00 2001 From: Chris Perelstein Date: Wed, 16 Jan 2013 17:02:20 -0500 Subject: [PATCH] Preserve offset when parsing times Changing scaler_scanner's parse_time function to return a time object with offset preserved if it was specified. --- lib/psych/scalar_scanner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb index 5935e26b..9e4d07f4 100644 --- a/lib/psych/scalar_scanner.rb +++ b/lib/psych/scalar_scanner.rb @@ -143,7 +143,7 @@ def parse_time string offset += ((tz[1] || 0) * 60) end - klass.at((time - offset).to_i, us) + klass.new(yy, m, dd, hh, mm, ss+us/1000000, offset) end end end