我正在尝试将日期字符串转换为另一种格式。我正在这样做。
NSLog(@"datestring is NOW %@",_dayObject.p_date);
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"YYYY-MM-DD"];
NSDate *date = [dateFormat dateFromString:_dayObject.p_date];
NSLog(@"date transformed %@",date);
[dateFormat setDateFormat:@"EEEE, dd/MM/YYYY"];
[dateFormat setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
NSString *dateStr = [dateFormat stringFromDate:date];
NSLog(@"datestring is AFTER %@",dateStr);
但这是我从我的 NSLOG 中得到的
2013-04-18 08:43:36.181 mosaqua2[9629:907] datestring is NOW 2013-05-04
2013-04-18 08:43:36.184 mosaqua2[9629:907] date transformed 2013-01-03 23:00:00 +0000
2013-04-18 08:43:36.184 mosaqua2[9629:907] datestring is AFTER donderdag, 03/01/2013
我想要的是
Saterday, 04/05/2013
有谁能够帮我 ?