summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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 0d15721b..3babefa2 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
- epoc = Workbook.date1904 ? Time.local(1904,1,1,0,0,0,0,v.zone) : Time.local(1900,1,1,0,0,0,0,v.zone)
- ((v - epoc) /60.0/60.0/24.0).to_f
+ epoc = Workbook.date1904 ? Time.local(1904,1,1,0,0,0,0) : Time.local(1900,1,1,0,0,0,0)
+ ((v.localtime - epoc) /60.0/60.0/24.0).to_f
elsif @type == :float
v.to_f
elsif @type == :integer