尝试这样:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Date c= sdf.parse("2015-05-26");String date=sdf.format(c);System.out.println(date);要以yyyy-MM-dd格式格式化当前日期,您可以尝试像这样
Date date = new Date();String str = new SimpleDateFormat("yyyy-MM-dd").format(date);请参考SimpleDateFormat



