I am using this code
NSDate *today = [NSDate date];
NSLog(@"%@",today);
In console it is showing
0024-03-06 07:51:46 +0000
Everything is ok except the year.It’s showing wrong year(0024).It should be (2012). Can anyone tell me how shall I get correct code.
My mac system date is right.
Please check your iPhone simulator calendar settings in
Settings -> General -> International -> Calendar ->Your current calendar is Japanese, if you set it to Gregorian then your problem will resolve.
and you also change it by using NSDateFormatter if you don’t want to change your simulator settings –