1

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

Community
  • 1
  • 1
Bigboytony
  • 123
  • 1
  • 9
  • 1
    Are you sure the date you are working with is local and not possible a UTC time? – jdi Mar 20 '12 at 07:03

1 Answers1

4

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/

Bigboytony
  • 123
  • 1
  • 9