Method: ClickHouse::Type::DateTimeType#cast

Defined in:
lib/click_house/type/date_time_type.rb

#cast(value, tz = nil) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/click_house/type/date_time_type.rb', line 8

def cast(value, tz = nil)
  if tz
    Time.find_zone(tz).strptime(value, FORMAT)
  else
    Time.strptime(value, FORMAT)
  end
end