Date date = new Date();System.out.println("前:" + date.toLocaleString());SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getDateTimeInstance(); System.out.println("后:" + sdf.format(date));
代码在线运行:
本文共 254 字,大约阅读时间需要 1 分钟。
Date date = new Date();System.out.println("前:" + date.toLocaleString());SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getDateTimeInstance(); System.out.println("后:" + sdf.format(date));
代码在线运行:
转载于:https://www.cnblogs.com/xiaostudy/p/11229811.html