DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Parse The Time In Ruby
require 'time'
d1 = Time.parse("2010-06-10 16:03:25 +0100")
#=> 2010-06-10 16:03:25 +0100
d2 = Time.parse("2010 Jun 10 16:03:25")
#=> 2010-06-10 16:03:25 +0100
Resources: - <a href="http://ruby-doc.org/core/classes/Time.html#M000305">Class: Time</a> [ruby-doc.org]




