Jump to content
We've recently updated our Privacy Statement, available here ×

modify month of a date


renevielma

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.MONTH, int month).

 


If the date was October 31, for example, and the month is set to June, then the new date will be treated as if it were on July 1, because June has only 30 days.

 

______

 

Calendar.getInstance().set(Calendar.MONTH, 4);

 

 



Post Edited by Nasir Amir at 02/07/09 13:14
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...