Sha256: c119d836afb22367714b764bdae20d193fbdb6b542ad808629a612e0877720d8

Contents?: true

Size: 582 Bytes

Versions: 44

Compression:

Stored size: 582 Bytes

Contents

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

module PG
	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

44 entries across 44 versions & 1 rubygems

Version Path
pg-1.6.0.rc1-x86_64-linux lib/pg/text_encoder/timestamp.rb
pg-1.6.0.rc1-x86-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.6.0.rc1-x64-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.6.0.rc1-x64-mingw-ucrt lib/pg/text_encoder/timestamp.rb
pg-1.6.0.rc1 lib/pg/text_encoder/timestamp.rb
pg-1.5.9-x86-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.5.9-x64-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.5.9-x64-mingw-ucrt lib/pg/text_encoder/timestamp.rb
pg-1.5.9 lib/pg/text_encoder/timestamp.rb
pg-1.5.8-x64-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.5.8-x64-mingw-ucrt lib/pg/text_encoder/timestamp.rb
pg-1.5.8-x86-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.5.8 lib/pg/text_encoder/timestamp.rb
pg-1.5.7-x86-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.5.7-x64-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.5.7-x64-mingw-ucrt lib/pg/text_encoder/timestamp.rb
pg-1.5.7 lib/pg/text_encoder/timestamp.rb
pg-1.5.6-x64-mingw-ucrt lib/pg/text_encoder/timestamp.rb
pg-1.5.6-x64-mingw32 lib/pg/text_encoder/timestamp.rb
pg-1.5.6-x86-mingw32 lib/pg/text_encoder/timestamp.rb