Sha256: 4ccabd8271103ddefb7a011c74d563e5a487f51897c1674ee792f57468131bc1

Contents?: true

Size: 584 Bytes

Versions: 3

Compression:

Stored size: 584 Bytes

Contents

# -*- ruby -*-
# frozen_string_literal: true

module YSQL
	module TextEncoder
		class TimestampWithoutTimeZone < SimpleEncoder
			def encode(value)
				value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S.%N") : value
			end
		end

		class TimestampUtc < SimpleEncoder
			def encode(value)
				value.respond_to?(:utc) ? value.utc.strftime("%Y-%m-%d %H:%M:%S.%N") : value
			end
		end

		class TimestampWithTimeZone < SimpleEncoder
			def encode(value)
				value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S.%N %:z") : value
			end
		end
	end
end # module PG

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yugabytedb-ysql-0.5 lib/ysql/text_encoder/timestamp.rb
yugabytedb-ysql-0.4 lib/ysql/text_encoder/timestamp.rb
yugabytedb-ysql-0.3 lib/pg/text_encoder/timestamp.rb