格式化时间日期

 

import java.util.*;
import java.text.*;

public class testmcn {
   public static void main(String args[]) {

      Date dNow = new Date( );
      SimpleDateFormat ft = 
      new SimpleDateFormat ("E yyyy.MM.dd 'at' hh:mm:ss a zzz");

      System.out.println("Current Date: " + ft.format(dNow));
   }
}

 输出

Current Date: 周二 2019.03.19 at 05:06:33 下午 GMT+08:00

  

 

posted @ 2019-03-19 17:06  anobscureretreat  阅读(146)  评论(0编辑  收藏  举报