struct tm sometime; |
const char *formatString = "%Y-%m-%d %H:%M:%S %z"; |
(void) strptime_l("2005-07-01 12:00:00 -0700", formatString, &sometime, NULL); |
NSLog(@"NSDate is %@", [NSDate dateWithTimeIntervalSince1970: mktime(&sometime)]); |
// Output: NSDate is 2005-07-01 12:00:00 -0700 |
NSDateFormatter替代
最新推荐文章于 2017-11-10 17:05:00 发布