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

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift