DatePicker problems in swift

Clément Bisaillon

(Sorry for my english)

I made a button to get the value of the DatePicker but the hours in the output is 4 hour late than in the DatePicker

My code:

@IBOutlet var date: UIDatePicker!

@IBAction func sauvegarderClicked(sender: AnyObject) {

    println(date.date)
}

Is this the correct way to get the value from the DatePicker ?

And at the end of the output there is a "+0000" how can i remove this?

Gene De Lisa

The date picker gives you the date in GMT.

Take a look at NSDateFormatter which will do what you want.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related