class HTTP::Cache::Headers

def to_time_or_epoch(t_str)

Returns:
  • (Time) - parses t_str at a time; if that fails returns epoch time
def to_time_or_epoch(t_str)
  Time.httpdate(t_str)
rescue ArgumentError
  Time.at(0)
end