Method: SqlCmd.unify_start_time

Defined in:
lib/sql_cmd/format.rb

.unify_start_time(start_time, timezone: ) ⇒ Object



59
60
61
62
63
# File 'lib/sql_cmd/format.rb', line 59

def unify_start_time(start_time, timezone: SqlCmd.config['environment']['timezone'])
  return EasyTime.at_timezone(Time.now, timezone) if start_time.nil? || start_time.to_s.strip.empty?
  return EasyTime.at_timezone(start_time, timezone) if start_time.is_a?(Time)
  EasyTime.stomp_timezone(start_time, timezone) # Stomp the timezone with the config timezone. If no start_time was provided, use the current time
end