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

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -