我想格式化來自coreData的日期。 我收到來自coredata日期與這行代碼:如何從coreData格式化NSDate並正確顯示它
[[managedObject valueForKey:@"presentationDate"] description]
我知道我可以格式化與NSDateFormatter的NSDate的。
這裏是我的代碼:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"dd.MMM.yyyy"];
NSDate *date = (NSDate *)
[[managedObject valueForKey:@"presentationDate"] description];
NSLog(@"theDate: |%@| \n", [dateFormat stringFromDate:date]);//output is null
輸出IST空。我無法找到正確的方式來正確輸出日期。請幫忙。
感謝您的這些信息,我不知道這一點。 – brush51 2011-12-21 14:59:15