0
這是我的代碼:不能正常字符串轉換成最新目標C
- (NSArray *)getCurrentDayEvents {
[dateFormat setDateFormat:@"dd/LL/YYYY"];
[currentDate retain];
NSString *todayStringDate = [dateFormat stringFromDate:currentDate];
return [eventiArray filteredArrayUsingPredicate:
[NSPredicate predicateWithFormat:@"(inizio CONTAINS[cd] %@)", todayStringDate] ];
}
我可以日期轉換爲字符串,但如果我添加類似:
NSDate *temp = [dateFormat dateFromString: todayStringDate];
我得到的東西像2010-12 -26總是... 我知道我在做一步的2倍..
順便說一句我打印的currentdate和我得到這個值:
2011-11-17 23:00:00 +0000
嘗試[dateFormat setDateFormat:@「dd/MM/yyyy」]; – nanjunda