java 时间格式化

xiaoxiao2021-02-28  109

java 时间格式化

Date dt = new Date();// 如果不需要格式,可直接用dt,dt就是当前系统时间 DateFormat df = new SimpleDateFormat("yyyy-MM-dd");// 设置显示格式 String dfDate = df.format(dt);//格式化之后的时间
转载请注明原文地址: https://www.6miu.com/read-70716.html

最新回复(0)