prader6

求某个时间,距离该天凌晨的毫秒数

  /**
     * 求某个时间距离这天凌晨的毫秒数
     * @param date
     * @return
     * @throws ParseException
     */
    public static long getMillonTimes(String date) throws ParseException {
        long time = new Date(date).getTime();
        SimpleDateFormat sdfOne = new SimpleDateFormat("yyyy-MM-dd");
        long overTime = (time - (sdfOne.parse(sdfOne.format(time)).getTime()))/1000;
        return overTime;
    }

posted on 2019-12-31 06:02  prader6  阅读(167)  评论(0编辑  收藏  举报

导航