I am trying to convert an am/pm format time to a 24 hour format time
6:35 PM to 18:35
I tried this piece of code on playground but it doesn't seem to
work if I put the time alone
let dateAsString = "02/12/15, 6:35 PM" let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "HH" let date = dateFormatter.dateFromString(dateAsString) //returns nil
Does anyone know how to accomplish this?