Timestamp -> formatted date & time

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?

Andreas

···


AVR-Tutorial, über 350 Links
Forum für AVRGCC und MSPGCC
-> http://www.mikrocontroller.net

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

···

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?

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
====================================