We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c1dfd6 commit 8f0c1ccCopy full SHA for 8f0c1cc
lib/fast_excel.rb
@@ -91,8 +91,11 @@ def self.lxw_time(time)
91
# https://support.microsoft.com/en-us/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel
92
def self.date_num(time, offset = nil)
93
unless offset
94
- # Try use Rails' app timezone
95
- if Time.respond_to?(:zone)
+ # Try use value utc_offset
+ if time.respond_to?(:utc_offset)
96
+ offset = time.utc_offset
97
+ # Else try use Rails' app timezone
98
+ elsif Time.respond_to?(:zone)
99
offset = Time.zone.utc_offset
100
else
101
offset = 0 # rollback to UTC
0 commit comments