The JavaScript date setDay() method sets the particular day of the week on the basis of local time.
Syntax:
dateObj.setDay(new_Day);
Example:
<!DOCTYPE html> <html> <body> <script> var date =new Date("May 11, 2019 21:00:10"); document.writeln(date.getDate() + "<br>"); date.setDate(23); document.writeln(date.getDate()); </script> </body> </html>