Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在将 nsstring 转换为 nsdate 时遇到了问题,任何人都可以帮我解决这个问题
如何在 Objective-c 中将此字符串“Mon, 10 Dec 2012 08:00:00 CST”转换为 NSDate
试试这个
NSString *dateString=@"Mon, 10 Dec 2012 08:00:00 CST"; NSDate *date=[NSDate dateWithNaturalLanguageString:dateString]; NSLog(@"Date is %@",date);
输出:
Date is 2012-12-10 08:00:00 -0600