iphone - convert time string to date format in ios swift -


i trying convert time string dateformat.i have tried following code.but not getting output.please me solve this.

let dateformatter = dateformatter()         let str = "12:30 am"         dateformatter.dateformat = "hh:mm a"         let cr = dateformatter.date(from: str)         print(cr) 

and output "1999-12-31 19:00:00 +0000"


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -