-1

the below post answered half of my question, but I still need to extract only the date without the time of the corrected date, would you kindly help me guys: xcode in swift datepicker picks wrong date

Community
  • 1
  • 1
nasser
  • 9
  • 6

1 Answers1

0

I could finally find a function that combines using locale time and getting the short format of the date only. below is what I used.

    @IBAction func DateChanged(sender: UIDatePicker) {



    let dateFormatter = NSDateFormatter.localizedStringFromDate(DatePicker.date, dateStyle: NSDateFormatterStyle.ShortStyle, timeStyle: .NoStyle)



    print(" Date: " + dateFormatter)

}
nasser
  • 9
  • 6