diff options
| author | Randy Morgan <[email protected]> | 2012-04-05 08:58:06 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-04-05 08:58:06 +0900 |
| commit | 1332f1260c958a84164732b622fe7345be7a3bfd (patch) | |
| tree | 20f1d9d1c7b958028700ed933259782d6a59f0cc /test/workbook/worksheet/tc_date_time_converter.rb | |
| parent | 6a828bfa7e1e101eeab3ac285f22e78c781c0f48 (diff) | |
| download | caxlsx-1332f1260c958a84164732b622fe7345be7a3bfd.tar.gz caxlsx-1332f1260c958a84164732b622fe7345be7a3bfd.zip | |
fixing spec for time serialization assuming timezone to be GMT+1 -
Diffstat (limited to 'test/workbook/worksheet/tc_date_time_converter.rb')
| -rw-r--r-- | test/workbook/worksheet/tc_date_time_converter.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/workbook/worksheet/tc_date_time_converter.rb b/test/workbook/worksheet/tc_date_time_converter.rb index adeae92b..09c1c507 100644 --- a/test/workbook/worksheet/tc_date_time_converter.rb +++ b/test/workbook/worksheet/tc_date_time_converter.rb @@ -111,12 +111,18 @@ class TestDateTimeConverter < Test::Unit::TestCase 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 |
