Changeset: b4cf00b05ef1 for monetdb-ruby
URL: http://dev.monetdb.org/hg/monetdb-ruby?cmd=changeset;node=b4cf00b05ef1
Modified Files:
        lib/MonetDBConnection.rb
Branch: default
Log Message:

Fix setting time zone for negative offsets.

Port of changesets 5247c923260e and 084abef09d5d from MonetDB.
This fixes bug 3985.


diffs (20 lines):

diff --git a/lib/MonetDBConnection.rb b/lib/MonetDBConnection.rb
--- a/lib/MonetDBConnection.rb
+++ b/lib/MonetDBConnection.rb
@@ -398,8 +398,14 @@ class MonetDBConnection
   def set_timezone()
     tz = Time.new
     tz_offset = tz.gmt_offset / @@HOUR
-      
-    if tz_offset <= 9 # verify minute count!
+
+    # verify minute count!
+    if tz_offset <= -10
+      tz_offset = "'" + tz_offset.to_s + ":00'"
+    elsif tz_offset < 0
+      tz_offset = -tz_offset
+      tz_offset = "'-0" + tz_offset.to_s + ":00'"
+    elsif tz_offset <= 9
       tz_offset = "'+0" + tz_offset.to_s + ":00'"
     else
       tz_offset = "'+" + tz_offset.to_s + ":00'"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to