标签:highlight out span date cst parse print eee 时间转换
1、java代码
String dateStr = "Mon Oct 26 15:19:15 CST 2020";
DateFormat formate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
DateFormat dateFormate = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
Date dateTime = dateFormate.parse(dateStr);
String dateString = formate.format(dateTime);
System.out.println(dateString);
2、转换结果
2020-10-26 15:19:15
标签:highlight out span date cst parse print eee 时间转换
原文地址:https://www.cnblogs.com/xiaomaomao/p/13878695.html