Sha256: 22599647f24168f8be26e616302c8fc4a0da36c1e2143d4cf4c1a2c846245870
Contents?: true
Size: 761 Bytes
Versions: 28
Compression:
Stored size: 761 Bytes
Contents
#!/usr/bin/env ruby module PG module TextEncoder class Date < SimpleEncoder STRFTIME_ISO_DATE = "%Y-%m-%d".freeze def encode(value) value.respond_to?(:strftime) ? value.strftime(STRFTIME_ISO_DATE) : value end end class TimestampWithoutTimeZone < SimpleEncoder STRFTIME_ISO_DATETIME_WITHOUT_TIMEZONE = "%Y-%m-%d %H:%M:%S.%N".freeze def encode(value) value.respond_to?(:strftime) ? value.strftime(STRFTIME_ISO_DATETIME_WITHOUT_TIMEZONE) : value end end class TimestampWithTimeZone < SimpleEncoder STRFTIME_ISO_DATETIME_WITH_TIMEZONE = "%Y-%m-%d %H:%M:%S.%N %:z".freeze def encode(value) value.respond_to?(:strftime) ? value.strftime(STRFTIME_ISO_DATETIME_WITH_TIMEZONE) : value end end end end # module PG
Version data entries
28 entries across 28 versions & 2 rubygems