日期:2014-05-17 浏览次数:20812 次
Calendar.getInstance().get(Calendar.DAY_OF_WEEK)
String weeks[] = {"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
Calendar weekStart = Calendar.getInstance();
weekStart.setTime(new Date());
int index = weekStart.get(Calendar.DAY_OF_WEEK);
System.out.println(weeks[index-1]);
/**
* Field number for <code>get</code> and <code>set</code> indicating the day
* of the week. This field takes values <code>SUNDAY</code>,
* <code>MONDAY</code>, <code>TUESDAY</code>, <code>WEDNESDAY</code>,
* <code>THURSDAY</code>, <code>FRIDAY</code>, and <code>SATURDAY</code>.
*
* @see #SUNDAY
* @see #MONDAY
* @see #TUESDAY
* @see #WEDNESDAY
* @see #THURSDAY
* @see #FRIDAY
* @see #SATURDAY
*/
public final static int DAY_OF_WEEK = 7;