java Calendar 根据周推算时间
java 中能否通过哪一周确定这周的时间范围?请大虾指教
[解决办法]
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Aloha {
public static void main(String[] args) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.WEEK_OF_YEAR, 10);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
System.out.println(formatter.format(calendar.getTime()));
}
}
2013-03-03 10:55:01