This article copy from: http://swxzqsd.blog.sohu.com/156208509.html
Camelcanoe
String today = "2010-01-11";
SimpleDateFormat format = new SimpleDateFormat ("Yyyy-mm-dd");
Date date = Format.parse (today);
Calendar calendar = Calendar.getinstance ();
Calendar.setfirstdayofweek (Calendar.monday);
Calendar.settime (date);
System.out.println (Calendar.get (calendar.week_of_year));
A somewhat complex code was used to determine the date of the week of the year. Look at the Calendar class, see the Week_of_year, very practical. But there was a little bit of a problem, such as 2010-01-03, when the result was 2 (two weeks in 2010), because the United States was the first day of the week in Sunday.
I thought of it. Change the starting day of the week, Setfirstdayofweek (int value), passing a 1, want to set Monday as the first day, but did not play an effect. After the document is changed into a calendar.monday, but it is not clear why the use of 1, with Calendar.monday on the line?
Fill: And look at the "constant field value", found that the value of Monday is not taken for granted at all 1, but 2.
Sunday:1
Mondya:2
Tuesday:3
Wednesday:4
Thursday:5
Friday:6
Saturday:7
Java gets the current week of "go"