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

Convert NsNumber, NSDate to String in iOS Swift

store cgpoint in userdefaults iOS swift