java格式化时间

public void static main(String[]args){

// System.out.println(System.currentTimeMillis());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss:SSS");
String formatStr =formatter.format(new Date());
System.out.println(formatStr);//2017-九月-15 13:17:08:355

SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
String formatStr2 =formatter2.format(new Date());
System.out.println(formatStr2);//2017-09-15 13:18:44:672

{

 

posted @ 2019-12-04 21:04  一杆梅子苟酒  阅读(1008)  评论(0编辑  收藏  举报