How to Get Week Number in Java
In this example, We will show you simple program about, How to get week number in Java. The program has been tested and output shared in the same post.
Example Program
package com.dineshkrish; import java.util.Calendar; /** * * @author Dinesh Krishnan * */ public class Example { public static void main(String[] args) throws Exception { Calendar now = Calendar.getInstance(); int weekNumber = now.get(Calendar.WEEK_OF_YEAR); System.out.println("The week number is : " + weekNumber); } }
Output
The week number is : 19
References
More from my site

Hello, folks, I am a founder of idineshkrishnan.com. I love open source technologies, If you find my tutorials are useful, please consider making donations to these charities.
No responses yet