i tried to convert this NSString date to NSDate
NSString *update_time= @"2012-03-09 14:54:30.0";
// convert to date
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"YYYY-MM-dd HH:mm:ss'.0'"];
[dateFormat setTimeZone:[NSTimeZone timeZoneWithName:@"Australia/Melbourne"]];
NSDate *dte = [dateFormat dateFromString:update_time ];
NSLog(@"Date: %@", dte);
but i’m getting Date: (null)
“GMT+4” is not a valid timzone name. Use
timeZoneForSecondsFromGMT:instead:If you want to use
timeZoneWithName:, you can get a list of valid timezone names using[NSTimeZone knownTimeZoneNames]. Those all have the form “Europe/Berlin” etc.