public class WeekOfMonth {
/**
* @param args
*/
public static void main(String[] args) {
String str = "2008-10-12";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(formatter.parse(str));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(calendar.get(Calendar.WEEK_OF_MONTH ));
SimpleDateFormat df = new SimpleDateFormat("dd");
String s = df.format(new Date());
System.out.println(s);
String lastday = "2008-10-31";
String aa = lastday.substring(8, 10);
System.out.println(aa);
}
}