本帖最后由 freefly310 于 2012-03-25 18:23:23 编辑

解决方案 »

  1.   

    为什么要这样取时间呢?直接Date d = new Date();d.toLocalString();不行么。
      

  2.   

    时区问题。该方法的作用是返回当前的计算机时间,时间的表达格式为当前计算机时间和GMT时间(格林威治时间)1970年1月1号0时0分0秒所差的毫秒数。System.out.println(new Date(System.currentTimeMillis()).toLocaleString());或者把电脑改为北京时区
      

  3.   

    new Date(System.currentTimeMillis()).toLocaleString()已经过时了
    用:DateFormat.getInstance().format(new Date())
      

  4.   

    java里面是用Calender today = calendar.getInstance();
    来获取当前时间的。
    建议参看Calendar的API