标签:color form parse date() code pre try led style
1.Date转String
Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dateTime = sdf.format(date);
2.String 转Date
String dateTime = "2019-01-01 01:01:01"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { Date date = sdf.parse(dateTime); } catch (ParseException e) { e.printStackTrace(); }
标签:color form parse date() code pre try led style
原文地址:https://www.cnblogs.com/unknownCode/p/12165052.html