public static void Main (string[] args) throws ClassNotFoundException,
IOException, ParseException {
SimpleDateFormat dateformatter = new SimpleDateFormat ("Yyyy-mm-dd");
String str = "2015-2-8";
System.out.println ("str=" +str);
Date date = Dateformatter.parse (str);
Dateformatter.applypattern ("D");
System.out.println ("Day of the Year:" + dateformatter.format (date));
Dateformatter.applypattern ("D");
System.out.println ("Day of the one months:" + dateformatter.format (date));
Dateformatter.applypattern ("w");
System.out.println ("Week of the Year:" + dateformatter.format (date));
Dateformatter.applypattern ("W");
System.out.println ("Week of the one months:" + dateformatter.format (date));
Dateformatter.applypattern ("E");
System.out.println ("Days in one weeks:" + dateformatter.format (date));
}
Java given a date, to find the corresponding week, day of the week, etc.