简体   繁体   中英

Incorrect time with NSDate

I have copied the following code from

get time and date by NSDate

to get the current time and date for my app.

I am unsure on how to set the correct time on my xcode but the time is always 12 hours behind.

This happens on both the simulator and my device.

Has anyone else experienced the same bug/situation/problem?

Thanks

Jdi, You are absolutely right.

I just had moment where I realised the time was only 11 hrs behind and not 12.

For anyone as stupid as I am, I have found a solution on another site.

http://buildingmyworld.wordpress.com/2011/04/13/get-local-time-from-iphone-local-nsdate/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM