diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index <HASH>..<HASH> 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -168,7 +168,7 @@ module Axlsx
     # @see Axlsx#date1904
     def cast_value(v)
       if (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time))
-        v = v.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
       elsif @type == :float
patch for <I> lack of to_time support on Time