Method: XlsFunction::Converters::TimeConverter.convert

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

.convert(input) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/xls_function/converters/time_converter.rb', line 15

def convert(input)
  case input
  when Time
    input
  when Date
    input.to_time
  when BigDecimal
    NumberConverter.decimal_to_time(input)
  when Numeric
    Time.at(input)
  else
    parse(input)
  end
end