I have a problem using NSDateFormatter in iPhone programming. Below is my code snippet.
NSString *inputDate = @"2011-03-14";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd"];
NSDate *entryDate = [formatter dateFromString:inputDate];
[formatter release]
The result I am getting is
2011-03-13 16:00:00 +0000
which is the GMT equivalent of 2011-03-14 00:00:00. (My time zone is GMT +08:00)
Why I am getting this? How to get 2011-03-14 00:00:00 as the result?
Thanks.
~Jan