UIdatePicker差1天

[formatter  setDateFormat :@"yyyy-MM-dd HH:mm:ss" ];

    NSTimeZone* sourceTimeZone = [NSTimeZone systemTimeZone];

    formatter.timeZone = sourceTimeZone;



+(NSDate *)stringDateToDate:(NSString *)date{

    NSDate *resultDate;

    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];

    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

    NSTimeZone* sourceTimeZone = [NSTimeZone systemTimeZone];

    formatter.timeZone = sourceTimeZone;

    resultDate = [formatter dateFromString:[NSString stringWithFormat:@"%@",date]];

    return resultDate;

}

你可能感兴趣的:(UIdatePicker差1天)