summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-30 08:10:13 +0900
committerRandy Morgan <[email protected]>2011-11-30 08:10:13 +0900
commit65b75c23c1911caeeb9206924cd6a009e241fb03 (patch)
treedd33730d33ab8fc76b6ddb3c3047b837bf0426ae /lib
parent1313e3b246cbddba3d0e6b1cdcc63be4e675b903 (diff)
downloadcaxlsx-65b75c23c1911caeeb9206924cd6a009e241fb03.tar.gz
caxlsx-65b75c23c1911caeeb9206924cd6a009e241fb03.zip
From the docs on time "On some operating systems, this offset is allowed to be negative." perhaps travis is one of those systems that does not allow negative offsets. Using the integer value for 1900 and 1904 epocs
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index a32d19e7..a279316b 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -169,8 +169,8 @@ module Axlsx
def cast_value(v)
if (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time))
v = v.respond_to?(:to_time) ? v.to_time : v
- epoc1900 = Time.local(1900, 1, 1)
- epoc1904 = Time.local(1904, 1, 1)
+ epoc1900 = -2209021200 #Time.local(1900, 1, 1)
+ epoc1904 = -2082877200 #Time.local(1904, 1, 1)
epoc = Workbook.date1904 ? epoc1904 : epoc1900
((v.localtime - epoc) /60.0/60.0/24.0).to_f
elsif @type == :float