請從我的SQL中讀取日期並將星期幾作爲數字返回。日期int到字符串(0 - > Sun,1 - > Mon等)
Calendar c = Calendar.getInstance();
c.setTime(rs.getDate("ShipmentDate"));
int DayOfWeek = c.get(Calendar.DAY_OF_WEEK);
這工作正常。
如何將結果(0,1,2,3,4,5,6)轉換爲(Sun,Mon,Tue,Wed,Thu,Fri,Sat)?
這個例子中,我使用一個數組捏造了上述代碼,但沒有舉例。
區域設置基於'地圖<整數,字符串>' – 2014-09-26 17:09:31
['日曆#getDisplayName'](http://docs.oracle.com/javase/7/docs /api/java/util/Calendar.html#getDisplayName(int,%20int,%20java.util.Locale))? – Volune 2014-09-26 17:13:48