I stuck in problem. When i put break point and show value of nsdate object, it shows correct but when i print it in NSLog() it display other time.
code:
NSDateFormatter *f = [[NSDateFormatter alloc] init];
[f setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
[f setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
NSDate *startDate = [f dateFromString:@"2014-01-17 15:30:00"];
NSLog(@"tim %@",startDate);
Image of breakpoint in xcode
nslog o/p:
2014-01-17 11:27:08.348 APP[596:a0b] tim 2014-01-17 10:00:00 +0000
Is it normal behaviour or bug of xcode?
Edit:
I am creating LocalNotification
based app so i want to use this as global time, so if my local is different it should be fire at i.e. 2014-01-17 15:30:00
, thats all.
Edit 2
As per answers and comment so use timezone so what is difference of NSLocale and NSTimeZone , because i have set nslocal to en_US.?
if i use defaults it will not let me problem?? i have fire localnotification at some perticuler time in all contry , so may it affect of time of call local notification?