renevielma Posted February 6, 2009 Share Posted February 6, 2009 HelloI need modify month of a date. I've tried with:new Date().setMonth( new Integer( 4 ).intValue() )for set month to april, but at compile, said me"Cannot cast from void to date"as whether "intValue()" return void any idea ? Link to comment Share on other sites More sharing options...
nkamir Posted February 7, 2009 Share Posted February 7, 2009 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now