How to find Week of Year


import java.util.Calendar;

public class WeekOfYear {

    public static void main(String[] args) {

        Calendar ca1 = Calendar.getInstance();

        /*
        set(int year, int month, int date)
        Jan=0,Feb=1,Mar=2...
        */
        ca1.set(2009,4,22);

        int WEEK_OF_YEAR=ca1.get(Calendar.WEEK_OF_YEAR);

        System.out.println("WEEK OF YEAR :"+WEEK_OF_YEAR);
    }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|