How to get the Current Week using the Calendar class



This example shows how to get the current week, both current week of the month and current week of the year.
It is done by calling the get() method of the Calendar class passing an integer value as parameter.
This integer value can be found as static variables of the Calendar class, WEEK_OF_MONTH and WEEK_OF_YEAR.

The output from this would be this if the date is November 27:







Search for more Java info on this site here:
Custom Search


Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">