Display date as hour and minute in text field iOS Swift



If you want to display the date as time only with an hour and minutes then follow the code.
                Code:
                let dates = NSDate()

                let dateFormater1 = DateFormatter()

                dateFormater1.dateFormat"h:mm a"
                let dateString = dateFormater1.string(from:dates  as! Date)

Comments

Popular posts from this blog

How to blink a button iOS swift?

iOS flutter while run to iPhone it had the error - Cannot find type 'PhoneNumberKit' in scope