How do I convert \"11am\" and \"10pm\" into \"11:00\" and \"22:00\"? Is there a simple way using the date and time classes?
The Time class has no parse method, but DateTime has.
require 'date' DateTime.parse("11pm").strftime("%H:%M") #=> "23:00"