about 11 years ago
Convert date format - 2013-10-31T07:41:39+0000 to 2013-10-31 01:48:11 +0000
NSString *dateString = [stringDate substringToIndex:19]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; formatter.timeZone = [NSTimeZone localTimeZone]; formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss"; NSDate *theDate = [formatter dateFromString:dateString]; NSLog(@"%@",theDate); formatter.dateFormat = @"MMM dd h:mma"; NSDateFormatter *df = [NSDateFormatter new]; [df setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZZZZ"]; //Create the date assuming the given string is in GMT df.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; NSDate *date = [df dateFromString:stringDate]; //Create a date string in the local timezone df.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:[NSTimeZone localTimeZone].secondsFromGMT]; df.dateFormat = @"MMM dd h:mma"; NSString *localDateString = [df stringFromDate:date]; NSLog(@"date = %@", localDateString);
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)