From: Daniel Harple Date: 2006-03-14T09:37:48+09:00 Subject: Re: formatting dates and times On Mar 14, 2006, at 1:28 AM, rtilley wrote: > In Python, I do this to format date and time in a certain fashion. > > q = time.strftime('%Y-%m-%d', time.localtime()) > r = time.strftime('%H:%M:%S', time.localtime()) > > I am formatting by YYYY-MM-DD and HH:MM:SS (I keep dashes between > the YYYY MM DD and colons between HH MM SS. > > How is this done in Ruby? See Time#strftime: Time.new.strftime('%Y-%m-%d') -> "2006-03-14" -- Daniel