how to get start and end time of today's date in ios? [duplicate]
问题 This question already has answers here : NSDate beginning of day and end of day (21 answers) Closed 3 years ago . I am getting current date and time by using this code let today: NSDate = NSDate() let dateFormatter: NSDateFormatter = NSDateFormatter() dateFormatter.timeStyle = NSDateFormatterStyle.MediumStyle dateFormatter.dateFormat = "yyyy-MM-dd hh:mm:ss" dateFormatter.timeZone = NSTimeZone(abbreviation: "SGT"); print(dateFormatter.stringFromDate(today)) but i want to get start time and end