w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
DateFormatter issue in iOS

You can use with below code :

NSDateFormatter* dateFormatter1 = [[NSDateFormatter alloc]
init];
[dateFormatter1 setDateFormat:@"dd/MM/yy HH:mm:ssZZZZZ"];
[dateFormatter1 setLocale:[[NSLocale alloc]
initWithLocaleIdentifier:@"en_US_POSIX"]];
NSDate *dateString = [dateFormatter1 dateFromString:@"01/09/13
20:55:00+02:00"];
NSLog(@"%@",dateString.description);

You can get your deserve date.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.