Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/time.rb

Instance Method Summary collapse

Instance Method Details

#to_sqlObject

call-seq: time.to_sql -> a_string

Returns a string that represents a database agnostic time.

Time.at(946702800).to_sql     #=> "to_timestamp('2000-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')"


7
8
9
# File 'lib/time.rb', line 7

def to_sql
  "to_timestamp('" + formatted + "', 'YYYY-MM-DD HH24:MI:SS')"
end