Class: PG::TextEncoder::TimestampWithoutTimeZone

Inherits:
SimpleEncoder
  • Object
show all
Defined in:
lib/pg/text_encoder.rb

Constant Summary collapse

STRFTIME_ISO_DATETIME_WITHOUT_TIMEZONE =
"%Y-%m-%d %H:%M:%S.%N".freeze

Instance Method Summary collapse

Instance Method Details

#encode(value) ⇒ Object



14
15
16
# File 'lib/pg/text_encoder.rb', line 14

def encode(value)
	value.respond_to?(:strftime) ? value.strftime(STRFTIME_ISO_DATETIME_WITHOUT_TIMEZONE) : value
end