-(void)reverseDateToString{
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"yyyy-MM-dd"];
NSDate *date = [[NSDate alloc]init];
NSString *dateStr = [formatter stringFromDate:date];
NSLog(@"date:---------%@",date);
NSLog(@"dateString:---------%@",dateStr);
}
-(void)reverseStringToDate{
NSString *dateStr = @"2016-12-02";
NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];
[dateformatter setDateFormat:@"yyyy-MM-dd"];
NSDate *date = [dateformatter dateFromString:dateStr];
NSLog(@"date:---------%@",date);
}