public class Test { |
public static void main(String args[]) { |
DateFormat df = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss SSS" ); |
Date d = new Date(0L); // |
把时间设为 0 ,表示到基准时间 |
// |
然后转换成为字符串看看是什么时候 |
String str = df.format(d); |
System.out.println( "基准时间是:" +str); |
} |
} //源代码片段来自云代码http://yuncode.net |
|