Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New To Rails - Date Format Help

Status
Not open for further replies.

jtropeano

Programmer
Aug 14, 2008
1
US
I have a date that is automatically created when a new record is made.

It is being output like this:

Created Date: 2008-08-25 21:21:34 UTC

How would I re-format this to something a little more user friendly? Also, would I put it in my view?

Thank you.
 
Sounds like you need the strftime function?
Not exactly sure how you are handling this date, but if you had it in a variable called createdDate, then try this:
Code:
createdDate.strftime("Created Date: %m/%d/%Y at %I:%M%p")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top