class="java">String dateString = "Fri Feb 01 00:00:00 GMT+08:00 2013"; SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy",Locale.US); TimeZone tz = TimeZone.getTimeZone("GMT+8"); sdf.setTimeZone(tz); String str = sdf.format(Calendar.getInstance().getTime()); System.out.println(str); Date s; try { s = sdf.parse(dateString); sdf = new SimpleDateFormat("yyyy-MM-dd"); System.out.println(sdf.format(s)); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); }
?