Jul/05
28
Formatting a timestamp
· Posted by Tom in Uncategorized
For some reason I’ve had to look this up twice recently and found it hard to find, so I’ll add it here. If you want to get a reasonable, human-readable version of a timestamp, here’s probably what you want:
obj.created_at.to_formatted_s(:db)
ActiveSupport::Date::Conversions
No tags
