I'm trying to create an Alarm, I let the user pick time from Date Picker (from library and Mode: Time). But when I run it on the simulator, The simulator gives me a different time. I will show you code below to see more detail.
@IBOutlet weak var timePicker: UIDatePicker!
I collected time on the simulator screen ( 10:10 AM ) and press button: The local time right now: 2016-05-14 10:10 AM
@IBAction func addTime(sender: UIButton) {
let time = timePicker.date
print("Time from picker: \(time)")
// The result : "Time from picker : 2016-05-14 03:10:39 +0000"
}
The problem right here, That's not correct time. I think some difference between NSDate() and local time right?.
The question: How can I sync them. Or do you have another idea ?
Thanks for your attention