RockPaperScissors

LizardSpock

Ruby Time Formats

| Comments

I have been playing around with getting my blog posts timestamped I found the Ruby Time Docs to be very useful on getting the format I wanted. I settled on :

$date_format = "%I:%M%p %b %d %Y"
Time.now.strftime($date_format)
#displays as 07:50PM Mar 30 2010 

Having this a a global means I can call it anywhere and teh time stamps will be displayed the same every where.

Comments