在我的代碼我收到日期字符串:將日期轉換爲java中的字符串?
date="2013-06-15"
我希望它轉換爲2013年6月15日。我曾嘗試過dateFormat:
DateFormat df = new SimpleDateFormat("yyyy-mm-dd");
String date = df.format(det);
DateFormat f2 = new SimpleDateFormat("dd-mmmm-yyyy");
date=f2.format(date).toLowerCase();
out.println("DATE"+date);
但它給了空指針可能任何人都可以幫助我做到這一點。請幫忙?
「字符串日期= df.format(DET);」什麼是det? – Bathsheba
NPE在哪裏拋出? – Kai