Method: BarkestCore::DateParser.parse_for_time_column

Defined in:
lib/barkest_core/concerns/date_parser.rb

.parse_for_time_column(value) ⇒ Object

Parses a value for storage in a datetime column.

Value should be a string in ‘M/D/YYYY HH:MM:SS’ or ‘YYYY-MM-DD HH:MM:SS’ format, but can also be a Date or Time object.

Returns a Time object or nil if value is invalid.



58
59
60
# File 'lib/barkest_core/concerns/date_parser.rb', line 58

def self.parse_for_time_column(value)
  Time.utc_parse(value) rescue nil
end