Java Date setDate() MethodThe setDate() method of Java Date class sets the day of the month of this date object to the specified argument. This method changes the date object so that it can represent a point in time within the specified day of the month, with the given year, month, hour, minute, and second same as interpreted in the local time zone. This method is deprecated as of JDK version 1.1 and is replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date). Syntax:Parametersdate - the day of month value between 1 and 31. ReturnNA Example 1Test it NowOutput: Old date is : 29 Date after setting is : 10 Next TopicJava Util Date |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India