Java Date setDate() MethodLast Updated : 17 Mar 2025 The 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 1Output: Old date is : 29 Date after setting is : 10 Next TopicJava Util Date |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India