Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何以字符串格式显示日期和月份。我想显示日期和月份。看起来像这样
Thursday 11 April
但是当我使用 Calender 类时,它会以不同的格式返回日期和日期,就像yyyy-mm-dd
yyyy-mm-dd
SimpleDateFormat sString s= "2013-1-18"; SimpleDateFormat sdf = new SimpleDateFormat("EEEE,MMMM, dd "); System.out.println(sdf.format(new SimpleDateFormat("yyyy-M-dd").parse(s)));