NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
[formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:28800]];
NSString * date_string = [NSString stringWithFormat:@"%@", [yourdata objectForKey:@"a_date"]];
NSDate * ed = [formatter dateFromString: date_string];
...
[formatter release];
That is! It is really tedious if you have to look back the reference for this convention! This can be a useful remainder.
沒有留言:
張貼留言