public String getWeekOfDate(Date dt) {
String[] weekDays = {"日", "一", "二", "三", "四", "五", "六"};
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0)
w = 0;
return weekDays[w];
}
本文共 278 字,大约阅读时间需要 1 分钟。
public String getWeekOfDate(Date dt) {
String[] weekDays = {"日", "一", "二", "三", "四", "五", "六"};
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0)
w = 0;
return weekDays[w];
}
转载于:https://blog.51cto.com/q1ngp2ng/1359049