Otherwise, the year, month, day of month, hour, minute, and second are interpreted in the local time zone. Sets the day of the month of this Date object to the specified value. This Date object is modified so that it represents a point in time within the specified day of the month, with the year,…