Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Specify the Date Value Outside of the Range</title> </head> <body> <script> var d = new Date(2018, 5, 24); // June 24, 2018 d.setDate(36); // Sets day to 36, new date will be July 6, 2018 document.write(d); </script> </body> </html>