C
Chris McMahon
How can I convert a string such as '2007-01-31 12:22:26' to a Time
object?
object?
How can I convert a string such as '2007-01-31 12:22:26' to a Time
object?
How can I convert a string such as '2007-01-31 12:22:26' to a Time
object?
Chris said:How can I convert a string such as '2007-01-31 12:22:26' to a Time
object?
Look athttp://whytheluckystiff.net/ruby/pickaxe/
.. see Time.mktime
.. first you should split(' ') ya string and then split the result,
order da stuff and put it into mktime...
Am 31.01.2007 um 22:20 schrieb Chris McMahon:
Time. parse seems to do the trick too...the ruby-units gem also has a helper for this...
'2007-01-31 12:22:26'.to_time #=3D> Wed Jan 31 12:22:26 EST 2007
_Kevin
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.