Hi All,
We have received a bug in our application saying that the values were shifted by one day back.
We have developed this application using the Objctive-C and please find the code snippet below.
-(NSString *)getDisplayDateFormat:(NSString *)dateString
{
NSLocale * enUSPOSIXLocale;
NSDateFormatter *inputformatter = [[NSDateFormatter alloc] init];
enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
[inputformatter setLocale:enUSPOSIXLocale];
inputformatter.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
[inputformatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZZZZ"];
NSDate *date= [inputformatter dateFromString:dateString];
NSDateFormatter *OutPutformatter = [[NSDateFormatter alloc] init];
[OutPutformatter setDateStyle: NSDateFormatterShortStyle];
NSString *dispalyDateString = [OutPutformatter stringFromDate:date];
return dispalyDateString;
}
dateString = 2017-01-16T00:00:00-06:00
date = 2017-01-16 06:00:00 +0000
displayDateString = 1/15/17
I have given the input a 16th Feb but got the output 15th Feb. Need your inputs to resolve the issue.