#pragma mark - NSDate <->NSString

-(NSDate *)getDateFromString:(NSString *)string

{

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

    [dateFormatter setDateFormat:@"yyyy-MM-dd-HH Z"];

    NSDate *date = [dateFormatter dateFromString:string];

    return date;

}


-(NSString*)getStringFromDate:(NSDate*)date

{

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

    [dateFormatter setDateFormat:@"yyyy MM dd HH"];

    

    NSString *string = [dateFormatter stringFromDate:date];

    

    return string;

}

비밀글