long tmp = getCount();
        Date da = new java.util.Date();
        DateFormat mFormat:
        da.setTime(tmp);
        String sTmp = mFormat.format(da);现在显示字符串为 小时:分种:秒现在要提高精度,怎么使sTmp中包括毫秒呢?谢谢!

解决方案 »

  1.   

    需要用到Clender这个类,Date这个类的精度没有那么大。
    DateStamp也行把。你在试试
      

  2.   

    到API里的java.text包里去看看DateFormat类和SimpleDateFormat类,相信你会找到答案的。
    还有java.util包里的Calendar类。多看看。
      

  3.   

    long now = System.currentTimeMillis();
    Date currentTime = new Date(now);
    SimpleDateFormat formatter = new SimpleDateFormat("yyMMddHHmmssSSS");
    String date = formatter.format(currentTime);
      

  4.   

    参考一下:java.text.SimpleDateFormat
      

  5.   

    使用java.text.SimpleDateFormatString sTmp = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date());