/*GMT时间格式z*/
//String dateString = "Tue, 05 Sep 2006 09:16:59 GMT +8";
//String pattern = "EEE, dd MMM yyyy HH:mm:ss z";
/*javascript tostring的时间*/
String dateString = "Mon Mar 9 09:48:16 UTC+0800 2009";
String pattern = "EEE MMM d HH:mm:ss Z+SSS yyyy";
SimpleDateFormat formatter = new SimpleDateFormat(pattern,Locale.US);
try {
Date date = formatter.parse(dateString);
System.out.println("date = " + date.toString());
}
catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
//String dateString = "Tue, 05 Sep 2006 09:16:59 GMT +8";
//String pattern = "EEE, dd MMM yyyy HH:mm:ss z";
/*javascript tostring的时间*/
String dateString = "Mon Mar 9 09:48:16 UTC+0800 2009";
String pattern = "EEE MMM d HH:mm:ss Z+SSS yyyy";
SimpleDateFormat formatter = new SimpleDateFormat(pattern,Locale.US);
try {
Date date = formatter.parse(dateString);
System.out.println("date = " + date.toString());
}
catch (Exception e) {
throw new RuntimeException(e.getMessage());
}