I am making NSDate
from this string but Every time I am getting Previous Month
from Selected Month
I am not able to find the bug:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setTimeZone:[NSTimeZone defaultTimeZone]];
[dateFormatter setDateFormat:@"dd/MMM/yyyy"];
NSDate *date = [dateFormatter dateFromString:strDate];
NSLog(@"------Date----%@",date);
I have tried with many Datestrings
some are with Logs are:
strDate =---- 01/Jan/2016
------Date----2015-12-31 18:30:00 +0000
strDate =----01/Dec/2015
------Date----2015-11-30 18:30:00 +0000