summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Rakefile5
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb4
2 files changed, 2 insertions, 7 deletions
diff --git a/Rakefile b/Rakefile
index 5695a0c4..12ec6a52 100644
--- a/Rakefile
+++ b/Rakefile
@@ -10,11 +10,6 @@ end
task :test do
require 'rake/testtask'
- puts "The current time is: #{Time.now}"
-
- puts "1900 was: #{Time.local(1900,1,1)}"
- puts "1904 was: #{Time.local(1904,1,1)}"
-
Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = FileList['test/**/tc_*.rb']
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