Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing spec for time serialization assuming timezone to be GMT+1 -

  • Loading branch information...
commit 1332f1260c958a84164732b622fe7345be7a3bfd 1 parent 6a828bf
Randy Morgan (@morgan_randy) randym authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 test/workbook/worksheet/tc_date_time_converter.rb
16 test/workbook/worksheet/tc_date_time_converter.rb
View
@@ -111,12 +111,18 @@ def test_time_to_serial_1904
end
def test_timezone
+
utc = Time.utc 2012 # January 1st, 2012 at 0:00 UTC
- local = begin
- Time.new 2012, 1, 1, 1, 0, 0, 3600 # January 1st, 2012 at 1:00 GMT+1
- rescue ArgumentError
- Time.parse "2012-01-01 01:00:00 +0100"
- end
+
+ # JRuby makes no assumption on time zone. randym
+ #local = begin
+ # Time.new 2012, 1, 1, 1, 0, 0, 3600 # January 1st, 2012 at 1:00 GMT+1
+ #rescue ArgumentError
+ # Time.parse "2012-01-01 01:00:00 +0100"
+ #end
+
+ local = Time.parse "2012-01-01 01:00:00 +0100"
+
assert_equal local, utc
assert_equal Axlsx::DateTimeConverter::time_to_serial(local), Axlsx::DateTimeConverter::time_to_serial(utc)
Axlsx::Workbook.date1904 = true
Please sign in to comment.
Something went wrong with that request. Please try again.