Date formatter for a certain format of date
问题 I might missing something, but I can't compose proper date formatter string for the date: 2016-01-14T10:24:26+0000 What is 'T' here? and how to include timezone? My string does not work: @"yyyy-MM-dd'T'hh:mm:ss Z" 回答1: You have to use 'T' in single quotes like below format to retrive string ftom date: yyyy-MM-dd'T'hh:mm:ssZ Let me know. 回答2: NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateFormat = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"; NSDate *yourDate =