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));}
本文共 232 字,大约阅读时间需要 1 分钟。
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));}
转载地址:http://vhcmo.baihongyu.com/