I have a string like 2009-10-09 08:39:20 +0000 and want to covert into an exact date format. Can anyone help me?
The date format is "yyyy-MM-dd HH:mm:ss +0000" (I don't know the meaning of +0000)
I have a string like 2009-10-09 08:39:20 +0000 and want to covert into an exact date format. Can anyone help me?
The date format is "yyyy-MM-dd HH:mm:ss +0000" (I don't know the meaning of +0000)
Use NSDateFormatter
like this
NSDateFormatter* df = [[NSDateFormatter alloc] init];
df.calendar = [NSCalendar currentCalendar];
df.dateStyle = NSDateFormatterMediumStyle;
[df setDateFormat:@"yyyy-MM-dd HH:mm:ss ZZZ"];
NSDate* tDate = [df dateFromString:@"2009-10-09 08:39:20 +0000"];