awkward silence |

Jul/05

28

Formatting a timestamp

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

Comments are closed.

<<

>>

Theme Design by devolux.nh2.me