随笔-71  评论-5  文章-0  trackbacks-0
    Date date = new Date("2014/1/10 18:20");
        Date date2 = new Date("2014/1/11 3:5");
        long temp = date2.getTime() - date.getTime();    //相差毫秒数
        long hours = temp / 1000 3600;                //相差小时数
        long temp2 = temp % (1000 3600);
        long mins = temp2 / 1000 60;                    //相差分钟数
        System.out.println("date2 与 date 相差" + hours + "小时"+ mins + "分钟");
posted on 2015-04-16 10:40 藤本蔷薇 阅读(131) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: