Class: DB::Postgres::Native::Types::Date

Inherits:
Object
  • Object
show all
Defined in:
lib/db/postgres/native/types.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



111
112
113
# File 'lib/db/postgres/native/types.rb', line 111

def name
	"DATE"
end

#parse(string) ⇒ Object



115
116
117
118
119
120
121
# File 'lib/db/postgres/native/types.rb', line 115

def parse(string)
	if string
		parts = string.split(/[\-\s:]/)
		
		return Time.utc(*parts)
	end
end