首页 > 代码库 > iOS 电商购物车倒计时时间计算

iOS 电商购物车倒计时时间计算

/**
 * 倒计时
 *
 * @param endTime 截止的时间戳
 *
 * @return 返回的剩余时间
 */
- (NSString*)remainingTimeMethodAction:(long long)endTime
{
    //得到当前时间
    NSDate *nowData = http://www.mamicode.com/[NSDate date];" From Now to %@, diff: Years: %ld Months: %ld, Days; %ld, Hours: %ld, Mins:%ld, sec:%ld",
          [nowData description], Year, Mon, Day, Hour, Min, Sec);
    NSString *countdown = [NSString stringWithFormat:@"还剩: %zi天 %zi小时 %zi分钟 %zi秒 ", Day,Hour, Min, Sec];
    if (Sec<0) {
        countdown=[NSString stringWithFormat:@"活动结束/开始抢购"];
    }
    return countdown;
} 

iOS 电商购物车倒计时时间计算