public static int getWeekOfDate ( String date ) { SimpleDateFormat formatter = new SimpleDateFormat ( "yyyy-MM-dd" ) ; int week = 0 ; ; Calendar c = Calendar . getInstance ( ) ; try { c . setTime ( formatter . parse ( date ) ) ; week = c . get ( Calendar . WEEK_OF_YEAR ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } return week ; }
Get the week of date