【发布时间】:2012-06-04 12:53:48
【问题描述】:
从过去两个小时开始我就在尝试这个,最后把它留给你们了:P
我需要转换这个 String Mon, 14 May 2012, 12:00:55 +0200
转换成 日期 dd/mm/yyyy hh:ss 格式..
我们将不胜感激任何对实现目标的帮助。
我的尝试
我曾尝试使用 NSDateFormatter,但无法确定上述日期的确切格式。
这个[dateFormatter setDateFormat:@"EEEddMM,yyyy HH:mm:ss"]; 是我尝试过的方式以及许多其他格式
例如:
NSString *finalDate = @"Tue, 29 May 2012, 14:24:56 +0200";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"EEEddMM,yyyy HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:finalDate];
这里的日期总是为零
【问题讨论】:
-
@Suriya 欢迎来到 stackoverflow
标签: iphone ios nsdateformatter