You can use DateTime::strptime
to parse, and DateTime#strftime
to format it again.
First require 'date'
and then:
2.0.0-p451 :021 > DateTime.strptime("03/27/2014 07:52:47 PM", "%m/%d/%Y %H:%M:%S %p").strftime("%Y-%m-%d %H-%M-%S %z")
=> "2014-03-27 19-52-47 +0000"