All, My initial list is rather busy. I would like to shorten the created_on and updated_on fields to just display the date, not the time. Best wold be a simple 12/28/05 type of presentation. I''ve found the format helpers in rdoc. (ie. distance_of_time_in_words_to_now ), but none seem to be what I''m looking for. How do I control the date format of a timestamp field? Thanks Greg -- Greg Freemyer The Norcross Group Forensics for the 21st Century
Rick Olson
2005-Dec-27 21:13 UTC
Re: created_on & updated_on - helper to display date only
On 12/27/05, Greg Freemyer <greg.freemyer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> All, > > My initial list is rather busy. I would like to shorten the > created_on and updated_on fields to just display the date, not the > time. Best wold be a simple 12/28/05 type of presentation. > > I''ve found the format helpers in rdoc. (ie. > distance_of_time_in_words_to_now ), but none seem to be what I''m > looking for. > > How do I control the date format of a timestamp field? > > Thanks > Greg > -- > Greg Freemyer > The Norcross Group > Forensics for the 21st Centuryhttp://rails.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Time/Conversions.html http://ruby-doc.org/core/classes/Time.html#M000249 -- rick http://techno-weenie.net
Greg Freemyer
2005-Dec-27 21:31 UTC
Re: created_on & updated_on - helper to display date only
On 12/27/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 12/27/05, Greg Freemyer <greg.freemyer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > All, > > > > My initial list is rather busy. I would like to shorten the > > created_on and updated_on fields to just display the date, not the > > time. Best wold be a simple 12/28/05 type of presentation. > > > > I''ve found the format helpers in rdoc. (ie. > > distance_of_time_in_words_to_now ), but none seem to be what I''m > > looking for. > > > > How do I control the date format of a timestamp field? > > > > Thanks > > Greg > > -- > > Greg Freemyer > > The Norcross Group > > Forensics for the 21st Century > > http://rails.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Time/Conversions.html > > http://ruby-doc.org/core/classes/Time.html#M000249 >.to_date was exactly what I wanted, thanks. Newbie question: I''ve got the pickaxe book and looking at the Time class (pg 642-649), I don''t see a .to_date method. Am I looking in the wrong place, or is the book out of date? Thanks Greg -- Greg Freemyer The Norcross Group Forensics for the 21st Century
Rick Olson
2005-Dec-27 22:00 UTC
Re: created_on & updated_on - helper to display date only
> > > I''ve found the format helpers in rdoc. (ie. > > > distance_of_time_in_words_to_now ), but none seem to be what I''m > > > looking for. > > > > > > How do I control the date format of a timestamp field? > > > > > > Thanks > > > GregIt''s a method added by rails. Notice the first link I gave you was for ActiveSupport (the Rails lib that adds those niceties, and other things like string inflection and fixnum extensions). -- rick http://techno-weenie.net
Maybe Matching Threads
- AR many-many join tables - can they have created_on, updated_on ?
- Created_on and updated_on in a non-ActiveRecord model
- Lighttpd now works for production. Development is broken?
- newbie radrails question
- Re: Manually running dispatch.fcgi fails (Please help!!)