java 怎么声明 Tue May 14 09:10:53 CST 2013格式的时间
java 怎么声明 Tue May 14 09:10:53 CST 2013格式的时间 Java
[解决办法]
java的Date类,默认就是cst格式时间。直接声明就行了。
[解决办法]
你去看一下这个百度文档吧,或许对你有帮助
http://wenku.baidu.com/view/e366a409ba1aa8114431d9bc.html
[解决办法]
String dateString = "Tue May 14 09:10:53 CST 2013";
dateString = dateString.replace("Jan", "01");
dateString = dateString.replace("Feb", "02");
dateString = dateString.replace("Mar", "03");
dateString = dateString.replace("Apr", "04");
dateString = dateString.replace("May", "05");
dateString = dateString.replace("Jun", "06");
dateString = dateString.replace("Jul", "07");
dateString = dateString.replace("Aug", "08");
dateString = dateString.replace("Sep", "09");
dateString = dateString.replace("Oct", "10");
dateString = dateString.replace("Nov", "11");
dateString = dateString.replace("Dec", "12");
SimpleDateFormat sdf = new SimpleDateFormat("EE MM dd HH:mm:ss 'CST' yyyy", Locale.US);
Date date = sdf.parse(dateString);
System.out.println(date);