Java Date Utility

Java Date Utility

View Answers

July 1, 2009 at 2:22 PM

Hi Friend,

Try the following code:

import java.util.*;

public class GetWeeks{

public static int getNumWeeksForYear(int year) {
Calendar c = Calendar.getInstance();
c.set(year, 0, 1);
return c.getMaximum(Calendar.WEEK_OF_YEAR);
}
public static void main(String[]args){
GetWeeks week=new GetWeeks();
int numOfWeeks= week.getNumWeeksForYear(2009);
System.out.println("Number of weeks are: "+numOfWeeks);
}
}

Thanks









Related Tutorials/Questions & Answers:
Java Date Utility - Java Beginners
Java Date Utility  How to determine the maximum number of weeks in a year (52 or 53) as per the ISO Calendar? Is there any standard method in java to implement this? Or any custom method which have been used? Help needed urgently
Singletone utility in java
Singletone utility in java  Please provide me an example of singletone utility in java
Advertisements
Java Date
Java Date  Hi, What is the API for Date management in Java? How use the Java Date API for manipulating date object in Java? Provide some... of API for working with date and time objects in Java. You can also use third
Java Date conversion - Date Calendar
Java Date conversion  How do I convert 'Mon Mar 28 00:00:00 IST 1983' which is a java.util.Date or String to yyyy/MM/dd date format in sql
Date Java - Java Beginners
Date Java  I'm using the eclipse software and I get an error for my...: public class Date { private int month; // 1-12 private int day; // 1-31... for day. public Date( int theMonth, int theDay, int theYear ) { if ( theMonth
Mysql Date To Java Date
Mysql Date To Java Date       Mysql Date To Java Date retrieve the records from Mysql and display the date in java. Understand with ExampleADS_TO_REPLACE_1 The Tutorial illustrate
how to add date and change date in java - netbeans
how to add date and change date in java - netbeans  I need to code use to increase date How to get date after 30 days using netbeans
Maven dependency for com.dua3.utility - utility version 10-BETA24 is released. Learn to use utility version 10-BETA24 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA24 ) in their Java... - utility version 10-BETA24 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA24.1 is released. Learn to use utility version 10-BETA24.1 in Maven based Java projects
; com.dua3.utility - utility version 10-BETA24.1 in Java projects. Follow the step by step... - utility version 10-BETA24.1 java library in your project. ADS_TO_REPLACE_2... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA25 is released. Learn to use utility version 10-BETA25 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA25 ) in their Java... - utility version 10-BETA25 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA26 is released. Learn to use utility version 10-BETA26 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA26 ) in their Java... - utility version 10-BETA26 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA19 is released. Learn to use utility version 10-BETA19 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA19 ) in their Java... - utility version 10-BETA19 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA17 is released. Learn to use utility version 10-BETA17 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA17 ) in their Java... - utility version 10-BETA17 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.2.4 is released. Learn to use utility version 10.2.4 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.2.4 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.2.4 java...Maven dependency for  com.dua3.utility  - Version 10.2.4 of utility
Maven dependency for com.dua3.utility - utility version 10-BETA23 is released. Learn to use utility version 10-BETA23 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA23 ) in their Java... - utility version 10-BETA23 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA22 is released. Learn to use utility version 10-BETA22 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA22 ) in their Java... - utility version 10-BETA22 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA21 is released. Learn to use utility version 10-BETA21 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA21 ) in their Java... - utility version 10-BETA21 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA20 is released. Learn to use utility version 10-BETA20 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA20 ) in their Java... - utility version 10-BETA20 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA18 is released. Learn to use utility version 10-BETA18 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA18 ) in their Java... - utility version 10-BETA18 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA16a is released. Learn to use utility version 10-BETA16a in Maven based Java projects
- utility version 10-BETA16a in Java projects. Follow the step by step tutorial... - utility version 10-BETA16a java library in your project. ADS_TO_REPLACE_2 Now you... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.2.5 is released. Learn to use utility version 10.2.5 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.2.5 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.2.5 java...Maven dependency for  com.dua3.utility  - Version 10.2.5 of utility
Maven dependency for com.dua3.utility - utility version 10.0.0 is released. Learn to use utility version 10.0.0 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.0.0 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.0.0 java...Maven dependency for  com.dua3.utility  - Version 10.0.0 of utility
Maven dependency for com.dua3.utility - utility version 10.0.0-RC8 is released. Learn to use utility version 10.0.0-RC8 in Maven based Java projects
- utility version 10.0.0-RC8 in Java projects. Follow the step by step tutorial... - utility version 10.0.0-RC8 java library in your project. ADS_TO_REPLACE_2 Now you... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA16 is released. Learn to use utility version 10-BETA16 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA16 ) in their Java... - utility version 10-BETA16 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA15 is released. Learn to use utility version 10-BETA15 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA15 ) in their Java... - utility version 10-BETA15 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA14 is released. Learn to use utility version 10-BETA14 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA14 ) in their Java... - utility version 10-BETA14 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA13.1 is released. Learn to use utility version 10-BETA13.1 in Maven based Java projects
; com.dua3.utility - utility version 10-BETA13.1 in Java projects. Follow the step by step... - utility version 10-BETA13.1 java library in your project. ADS_TO_REPLACE_2... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA13.0.1 is released. Learn to use utility version 10-BETA13.0.1 in Maven based Java projects
; com.dua3.utility - utility version 10-BETA13.0.1 in Java projects. Follow the step...; com.dua3.utility - utility version 10-BETA13.0.1 java library in your project. ADS... of utility released The developers of   com.dua3.utility - utility
Maven dependency for com.dua3.utility - utility version 10-BETA13 is released. Learn to use utility version 10-BETA13 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA13 ) in their Java... - utility version 10-BETA13 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA12 is released. Learn to use utility version 10-BETA12 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA12 ) in their Java... - utility version 10-BETA12 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA11 is released. Learn to use utility version 10-BETA11 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA11 ) in their Java... - utility version 10-BETA11 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.1.1 is released. Learn to use utility version 10.1.1 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.1.1 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.1.1 java...Maven dependency for  com.dua3.utility  - Version 10.1.1 of utility
Maven dependency for com.dua3.utility - utility version 10.1.0 is released. Learn to use utility version 10.1.0 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.1.0 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.1.0 java...Maven dependency for  com.dua3.utility  - Version 10.1.0 of utility
Maven dependency for com.dua3.utility - utility version 10.1.0-RC1 is released. Learn to use utility version 10.1.0-RC1 in Maven based Java projects
- utility version 10.1.0-RC1 in Java projects. Follow the step by step tutorial... - utility version 10.1.0-RC1 java library in your project. ADS_TO_REPLACE_2 Now you... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.2.2 is released. Learn to use utility version 10.2.2 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.2.2 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.2.2 java...Maven dependency for  com.dua3.utility  - Version 10.2.2 of utility
Maven dependency for com.dua3.utility - utility version 10.2.1 is released. Learn to use utility version 10.2.1 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.2.1 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.2.1 java...Maven dependency for  com.dua3.utility  - Version 10.2.1 of utility
Maven dependency for com.dua3.utility - utility version 10.2.0 is released. Learn to use utility version 10.2.0 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.2.0 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.2.0 java...Maven dependency for  com.dua3.utility  - Version 10.2.0 of utility
Maven dependency for com.dua3.utility - utility version 10.1.2 is released. Learn to use utility version 10.1.2 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.1.2 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.1.2 java...Maven dependency for  com.dua3.utility  - Version 10.1.2 of utility
Maven dependency for com.dua3.utility - utility version 10-BETA10 is released. Learn to use utility version 10-BETA10 in Maven based Java projects
use this version ( com.dua3.utility - utility version 10-BETA10 ) in their Java... - utility version 10-BETA10 in Java projects. Follow the step by step tutorial... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10-BETA9 is released. Learn to use utility version 10-BETA9 in Maven based Java projects
version of  com.dua3.utility - utility library is 10-BETA9. Developer can use this version ( com.dua3.utility - utility version 10-BETA9 ) in their Java... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.2.3 is released. Learn to use utility version 10.2.3 in Maven based Java projects
this version ( com.dua3.utility - utility version 10.2.3 ) in their Java project... that downloads and includes  com.dua3.utility - utility version 10.2.3 java...Maven dependency for  com.dua3.utility  - Version 10.2.3 of utility
Maven dependency for com.dua3.utility - utility version 10.0.0-BETA8 is released. Learn to use utility version 10.0.0-BETA8 in Maven based Java projects
; com.dua3.utility - utility version 10.0.0-BETA8 in Java projects. Follow the step by step...; com.dua3.utility - utility version 10.0.0-BETA8 java library in your project. ADS... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-BETA6 is released. Learn to use utility version 10.0.0-BETA6 in Maven based Java projects
; com.dua3.utility - utility version 10.0.0-BETA6 in Java projects. Follow the step by step...; com.dua3.utility - utility version 10.0.0-BETA6 java library in your project. ADS... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-BETA5 is released. Learn to use utility version 10.0.0-BETA5 in Maven based Java projects
; com.dua3.utility - utility version 10.0.0-BETA5 in Java projects. Follow the step by step...; com.dua3.utility - utility version 10.0.0-BETA5 java library in your project. ADS... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-BETA4 is released. Learn to use utility version 10.0.0-BETA4 in Maven based Java projects
; com.dua3.utility - utility version 10.0.0-BETA4 in Java projects. Follow the step by step...; com.dua3.utility - utility version 10.0.0-BETA4 java library in your project. ADS... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-BETA3 is released. Learn to use utility version 10.0.0-BETA3 in Maven based Java projects
; com.dua3.utility - utility version 10.0.0-BETA3 in Java projects. Follow the step by step...; com.dua3.utility - utility version 10.0.0-BETA3 java library in your project. ADS... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-RC5 is released. Learn to use utility version 10.0.0-RC5 in Maven based Java projects
- utility version 10.0.0-RC5 in Java projects. Follow the step by step tutorial... - utility version 10.0.0-RC5 java library in your project. ADS_TO_REPLACE_2 Now you... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-RC4 is released. Learn to use utility version 10.0.0-RC4 in Maven based Java projects
- utility version 10.0.0-RC4 in Java projects. Follow the step by step tutorial... - utility version 10.0.0-RC4 java library in your project. ADS_TO_REPLACE_2 Now you... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-RC3 is released. Learn to use utility version 10.0.0-RC3 in Maven based Java projects
- utility version 10.0.0-RC3 in Java projects. Follow the step by step tutorial... - utility version 10.0.0-RC3 java library in your project. ADS_TO_REPLACE_2 Now you... of utility released The developers of   com.dua3.utility - utility project
Maven dependency for com.dua3.utility - utility version 10.0.0-RC2 is released. Learn to use utility version 10.0.0-RC2 in Maven based Java projects
- utility version 10.0.0-RC2 in Java projects. Follow the step by step tutorial... - utility version 10.0.0-RC2 java library in your project. ADS_TO_REPLACE_2 Now you... of utility released The developers of   com.dua3.utility - utility project

Ads