NSDate *nowDate1 = [NSDatedate];
NSDateFormatter *formatter = [[[NSDateFormatteralloc] init] autorelease];
[formatter setDateFormat:(@"yyyy-MM-dd")];
NSMutableString *dateStr = [NSMutableStringstringWithString: [formatter stringFromDate:nowDate1]];//[NSMutableString stringWithFormat: @"%@ 00:00:00 +0000"];
NSLog(@"%@", dateStr);
nowDate1 = [self NSStringDateToNSDate: dateStr];
NSLog(@"%@",nowDate1);
- (NSDate *)NSStringDateToNSDate:(NSString *)string
{
NSDateFormatter *formatter = [[NSDateFormatteralloc] init];
[formatter setTimeZone:[NSTimeZonetimeZoneWithAbbreviation:@"UTC"]];
#define kDEFAULT_DATE_TIME_FORMAT (@"yyyy-MM-dd")
[formatter setDateFormat:kDEFAULT_DATE_TIME_FORMAT];
NSDate *date = [formatter dateFromString:string];
[formatter release];
return date;
}