从数组中提取时更改日期

时间:2014-05-15 06:38:28

标签: ios

我使用此代码将日期存储在数组中

NSDateFormatter *dateformat = [[NSDateFormatter alloc] init];
[dateformat setDateFormat:@"MM/dd/YYYY"];
today = [NSDate date];
[checkinArray addObject:today];

在它存储的数组中     checkinArray         [0] = 2014-05-22 11:21:09 IST

当我通过此声明从数组中提取日期时

NSString *dummystr = [[NSString alloc]initWithFormat:@"%@",[checkinArray lastObject]];

日期一直在变为另一个时区

即,2014-05-22 05:51:09 +0000

提前感谢,任何帮助都很明显。

0 个答案:

没有答案
相关问题