Class: ParameterSubstitution::Formatters::DateTimeUtcYearFirstDashesSeconds

Inherits:
DateTimeFormat
  • Object
show all
Defined in:
lib/parameter_substitution/formatters/date_time_utc_year_first_dashes_seconds.rb

Constant Summary

Constants inherited from DateTimeFormat

ParameterSubstitution::Formatters::DateTimeFormat::MINIMUM_INTEGER_TIME

Class Method Summary collapse

Methods inherited from DateTimeFormat

from_custom_time, from_parse, from_unix_time_ms, from_unix_time_sec, from_yyyymmddhhmmssss, parse_to_time

Methods inherited from Base

encoding, has_parameters?, key, parse_duration

Class Method Details

.descriptionObject



4
5
6
# File 'lib/parameter_substitution/formatters/date_time_utc_year_first_dashes_seconds.rb', line 4

def self.description
  "2017-04-11 15:55:10 (UTC)"
end

.format(value) ⇒ Object



8
9
10
# File 'lib/parameter_substitution/formatters/date_time_utc_year_first_dashes_seconds.rb', line 8

def self.format(value)
  parse_to_time(value)&.utc&.strftime('%Y-%m-%d %H:%M:%S')
end