如何fri oct 31 16:19:48 cst 2014改为date格式
1个回答

利用SimpleDateFormat类

// Format the current time.

SimpleDateFormat formatter

= new SimpleDateFormat ("yyyy.MM.dd G 'at' hh:mm:ss a zzz");

Date currentTime_1 = new Date();

String dateString = formatter.format(currentTime_1);

// Parse the previous string back into a Date.

ParsePosition pos = new ParsePosition(0);

Date currentTime_2 = formatter.parse(dateString,pos);