Method: XlsFunction::Converters::TimeSerialConverter.time_to_serial

Defined in:
lib/xls_function/converters/time_serial_converter.rb

.time_to_serial(time, except_date: false) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/xls_function/converters/time_serial_converter.rb', line 12

def time_to_serial(time, except_date: false)
  (except_date ? 0 : DateSerialConverter.date_to_serial(time.to_date)) +
    (
      hour_value_of(time) +
      minute_value_of(time) +
      second_value_of(time) +
      millisecond_value_of(time)
    ).round(15)
end