解决方案 »

  1.   

    你这个不是标准的美国格式时间,只是换个符号的话,这样做:String oldDate="2014-08-19";
    Date date = new SimpleDateFormat("yyyy-MM-dd").parse(oldDate);
    String newDate = new SimpleDateFormat("yyyy/MM/dd").format(date);
    System.out.println("oldDate is:"+oldDate);
    System.out.println("newDate is:"+newDate);
      

  2.   

    String date="2014-08-09";
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 设置日期格式     这里可以随意设置格式的
    df.format(date);
      

  3.   

    另外如果在oracle里面的话,时间转时间,可以使用to_char和to_date结合,to_char能将时间抓换为字符串,格式自己随意设置;to_date能将字符串转换为时间,不能将时间转换为时间。
    可以用trunc(date,‘format’)。trunc(date, 'dd')即可以拿到你要去的结果。
      

  4.   

    用SimpleDateFormat进行格式化呀,你那只是显示的问题!