public static void main(String[] args) { Date date = new Date(); Long time = date.getTime(); System.out.println(time); Date d = new Date(time); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); System.out.println(sdf.format(d)); }
public static void main(String[] args) { Date date = new Date(); Long time = date.getTime(); System.out.println(time); Date d = new Date(time); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); System.out.println(sdf.format(d)); }