NSDateFormatter
提供默认日期
2001-01-01 00:00:00 +0000
我需要将其格式化为 January, 01 2013 04:00:00 的格式
这是我的代码:
NSDateFormatter *formatter=[[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMMM, dd yyyy HH:mm:ss"];
NSDate *startDt=[_calendarDetailsDict objectForKey:@"dtStart"];
NSDate *endDt=[_calendarDetailsDict objectForKey:@"dtEnd"];
NSString *str=[formatter stringFromDate:startDt];
NSString *str1=[formatter stringFromDate:endDt];