根据已知时间加上数小时,包括小数点

public long getEndTime(Date beginTime,String spendTime){
        long endTie = 0;
        if(spendTime.contains(".")){
            long spendTimen =  (long) (Double.parseDouble(spendTime)*1000*60*60);
            endTie = (beginTime.getTime()+spendTimen);
        }else{
             long spendTimen =  (long) (Integer.parseInt(spendTime)*1000*60*60);
                endTie = (beginTime.getTime()+spendTimen);
        }
        return endTie;
    }

 

posted @ 2017-02-27 20:14  滴滴滴滴哒  阅读(233)  评论(0编辑  收藏  举报