Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/time.rb
Instance Method Summary collapse
-
#to_sql ⇒ Object
call-seq: time.to_sql -> a_string.
Instance Method Details
#to_sql ⇒ Object
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 |