PG::TextDecoder::

TimestampWithTimeZone

class
Superclass
PG::SimpleDecoder

This is a decoder class for conversion of PostgreSQL text timestamps to Ruby Time objects.

The following flags can be used to specify time interpretation when no timezone is given:

Example:

deco = PG::TextDecoder::Timestamp.new(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL)
deco.decode("2000-01-01 00:00:00")  # => 2000-01-01 01:00:00 +0100
deco.decode("2000-01-01 00:00:00.123-06")  # => 2000-01-01 00:00:00 -0600