syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
In Ruby how do I convert string to DateTime?

Let Ruby do the talking:
(byebug) DateTime.strptime("2014-12-9",'%Y-%m-%d')
#<DateTime: 2014-12-09T00:00:00+00:00 ((2457001j,0s,0n),+0s,2299161j)>
(byebug) 


syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me