On 23 Sep 2007, at 22:47, Jean-nicolas Jolivet wrote:
> I have a database with unix timestamps in it (saved as varchar)...
>
> Right now I''m using the following to format it (item table,
created_at
> field)...:
>
>
> Time.at(item.created_at.to_i).strftime("%Y-%m-%d %H:%M:%S")
>
> I was wondering if it''s the most effective way to do it? Or if
> there is
> a quicker way?
item.create_at.to_formatted_s(:db)
Same can be done with dates.
Best regards
Peter De Berdt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---