阅读背景:

如何在目标c中将秒转换为UnixtimeStamp?

来源:互联网 
 NSDate *now = [NSDate date];
    NSCalendar *calendar =  [NSCalendar currentCalendar];
    // find next date where the minutes are zero
    NSDate *nextHour = [calendar nextDateAfterDate:now matchingUnit:NSCalendarUnitMinute value:0 options:NSCalendarMatchNextTime];
    // get the number of seconds between now and next hour
    NSDateComponents *componentsToNextHour = [calendar components:NSCalendarUnitSecond fromDate:now toDate:nextHour options:0];
    //NSLog(@"%ld", componentsToNextHour.second);
    NSString *dec = [NSString stringWithFormat:@"%ld", (long)componentsToNextHour.second];
 NSDate *now = [NSDate date];
    NSCalendar *c



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: