Converting a date to mysql format

11 views
Skip to first unread message

Chris.Mohr

unread,
Apr 7, 2009, 2:44:30 PM4/7/09
to Ruby on Rails: Talk
Is there an easy way to convert '13-Mar-2009 20:55 PDT' into something
that ruby understands, so that I can output it in a format that mysql
understands?

Thanks,
Chris

Phlip

unread,
Apr 7, 2009, 2:54:21 PM4/7/09
to rubyonra...@googlegroups.com
Chris.Mohr wrote:

Does this work?

t = Time.parse('13-Mar-2009 20:55 PDT')
p t.to_s(:db)

Reply all
Reply to author
Forward
0 new messages