package test;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class DateFormat {
public static void main(String[] args) {
String a = "06May09";
try {
SimpleDateFormat dateFm = new SimpleDateFormat("ddMMMyy",
new Locale("US")); // 格式化当前系统日期
Date dateTime = dateFm.parse(a);
dateFm = new SimpleDateFormat("yyyyMMdd");
System.out.println(dateFm.format(dateTime).toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
咋把"06May09"搞到"yyyy-MM-dd"
最新推荐文章于 2019-01-31 12:26:51 发布