标签:system gettime 日期 src img style 就是 inf 2018年
public class CounterDate { public static void main(String[] args) { Date s = new Date(); System.out.println("一般日期输出:"+s);// Wed Oct 10 19:38:23 CST 2018 System.out.println("时间戳:"+s.getTime());//1539224163083 SimpleDateFormat f =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = f.format(s.getTime());//这个就是把时间戳经过整理得到期望的时间 System.out.println("格式化结结果:"+time);// 2018-10-11 10:13:43 SimpleDateFormat f1 =new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒"); time = f1.format(s.getTime()); System.out.println(time);//2018年10月11日 10时17分30秒 } }
标签:system gettime 日期 src img style 就是 inf 2018年
原文地址:https://www.cnblogs.com/sunnybowen/p/9858466.html