From: ahoward Date: 2003-05-06T07:02:16+09:00 Subject: Re: timestamp -> formatted date & time On Mon, 5 May 2003, Andreas Schwarz wrote: > Hello, > > I get a DATETIME field from a MySQL DB and am looking for an easy way to > format it. In PHP I would have used date(formatstring, time), what is > the best way to do it in Ruby? don't know if DATETIME is numeric or text (i use postgresql) but convert to a Time object, perhaps using ParseDate, then use Time#strftime. it's just like the C funtion. it may be easiest to ask mysql to do the formatting for you. -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ara.t.howard@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================