public void getDate()
{
String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"
};
Calendar cal =
Calendar.getInstance();
Date curDate =
new Date(System.currentTimeMillis());
cal.setTime(curDate);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1
;
if (w < 0
)
w = 0
;
System.out.println("--------------"+
weekDays[w]);
}
转载于:https://www.cnblogs.com/tianshidechibang234/p/3441034.html
相关资源:显示星期几 源码