目前数据库读出来的如期是2009-10-28 我如何把他动态转换为 “28 October 2009” 这样的日期格式

解决方案 »

  1.   


    java.util.Date date = java.sql.Date.valueOf("2009-10-28");
    SimpleDateFormat df = new SimpleDateFormat("dd MMMM yyyy", Locale.ENGLISH);
    System.out.println(df.format(date));
      

  2.   

    确实,涉及到日期格式化,就用java.text.SimpleDateFormat 
      

  3.   

    /**
     * 系统时间转换为 September18,2009 格式
     * @return
     */
    public static String getEDate() {
    Date date = new Date();
            SimpleDateFormat sdf = new SimpleDateFormat("MMMMdd,yyyy",Locale.US);
            String times = sdf.format(date);
            return times;
    }把MMMMdd,yyyy改成dd MMMM yyyy