标签:throws simple gettime demo system ring code orm oid
package cm.szz.demo01.demon09date; import java.text.*; import java.util.Date; public class Demon09Date { public static void main(String[] args) throws ParseException { Date time = new Date(); Date t = new Date(0L); System.out.println(time);//空参构造获取当时时间Fri Dec 27 20:03:32 CST 2019 System.out.println(t);//把毫秒值转化Thu Jan 01 08:00:00 CST 1970 long time1 = time.getTime();//获取当前时间的毫秒值 System.out.println(time1); demon(); } public static void demon() throws ParseException { SimpleDateFormat sdm = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒"); String format = sdm.format(26266666); Date date = sdm.parse("1970年01月01日 15时17分46秒"); System.out.println(format); System.out.println(date); } }
标签:throws simple gettime demo system ring code orm oid
原文地址:https://www.cnblogs.com/xzwx668/p/12109561.html