标签:new str date() 系统时间 form 格式 ati imp 输出
public class TimeFour {
public static void main(String[] args) throws ParseException{
TimeFour four = new TimeFour();
four.test();
}
public void test() throws ParseException{
Date date = new Date();
DateFormat df3 = new SimpleDateFormat("yyy-MM-dd HH-mm-ss");
DateFormat df4 = new SimpleDateFormat("yyy年MM月dd日 HH时mm分ss秒");
System.out.println("按照指定格式 yyyy年MM月dd日 hh时mm分ss秒 ,区域为中文:" + df4.format(date));
System.out.println("按照指定格式 yyyy年MM月dd日 hh时mm分ss秒 ,区域为中文:" + df3.format(date));
Date date4 = df4.parse("2007年11月30日 02时51分18秒");
System.out.println(date4);
}
}
标签:new str date() 系统时间 form 格式 ati imp 输出
原文地址:https://www.cnblogs.com/THEONLYLOVE/p/9117723.html