example will Wed, 02 Oct 2002 15:00:00 +0200 The default format is converted to date format
------ Solution --------- -----------------------------------
public static String dateFormat(java.util.Date date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(date);
}
------ For reference only ---------------------------------------
LS positive solution . . .
 ------ For reference only ---------------------------------------
public staticString dateFormat (java . util.Date date) {
SimpleDateFormat sdf = newSimpleDateFormat ("yyyy-MM-dd HH: mm: ss");
returnsdf.format (date);
}
没有评论:
发表评论