Long time=System.currentTimeMillis();
Date date=new Date(time);
String mat="yyyy-MM-dd";
String ma="yyyyMMdd";
SimpleDateFormat format=new SimpleDateFormat(mat);
SimpleDateFormat forma=new SimpleDateFormat(ma);
String nowdate=format.format(date);
String nwdate=forma.format(date);
int x=Integer.parseInt(nwdate);
System.out.println(nowdate);
System.out.println(nwdate);
System.out.println(x);
System.out.println(date);
时间: 2024-10-07 09:02:31