Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- record = Record.find(:first)
- record.the_time = Time.now()
- <%= h record.the_time %>
- record = Record.find(:first)
- puts record.the_time
- Wed Nov 26 00:40:00 (-0800) 2008
- # Make Time.zone default to the specified zone, and make Active Record store time values
- # in the database in UTC, and return them converted to the specified local zone.
- # Run "rake -D time" for a list of tasks for finding time zone names. Uncomment to use default local time.
- config.time_zone = 'UTC'
- require 'active_support/core_ext/date/conversions'
- record.the_time.utc.to_s(:db)
Add Comment
Please, Sign In to add comment