package com.dxhy.common.util;

import java.util.Calendar;
import java.util.Date;

/**
 * @author jiaohongyang
 */
public class DateOrderUtil {

    /**
     * 获取当前时间离一天结束剩余秒数
     */
    public static Integer getRemainSecondsOneDay(Date currentDate) {
        Calendar midnight = Calendar.getInstance();
        midnight.setTime(currentDate);
        midnight.add(Calendar.DAY_OF_MONTH, 1);
        midnight.set(Calendar.HOUR_OF_DAY, 0);
        midnight.set(Calendar.MINUTE, 0);
        midnight.set(Calendar.SECOND, 0);
        midnight.set(Calendar.MILLISECOND, 0);
        return (Integer)(int)((midnight.getTime().getTime() - currentDate.getTime()) / 1000);
    }

}
