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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift