class PG::BinaryEncoder::Timestamp

This is a encoder class for conversion of Ruby Time objects to PostgreSQL binary timestamps.

The following flags can be used to specify timezone interpretation:

Example:

enco = PG::BinaryEncoder::Timestamp.new(flags: PG::Coder::TIMESTAMP_DB_UTC)
enco.encode(Time.utc(2000, 1, 1))  # => "\x00\x00\x00\x00\x00\x00\x00\x00"

String values are expected to contain a binary data with a length of 8 byte.