screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <title>Date Check</title> </head> <body> <p>Date :2024-02-15 </p> <script> function isInCurrentMonthAndYear(date) { const currentDate = new Date(); return ( date.getMonth() === currentDate.getMonth() && date.getFullYear() === currentDate.getFullYear() ); } // Example usage: const myDate = new Date("2024-02-15"); // Replace this with your date document.write( isInCurrentMonthAndYear(myDate) ? "The date is in the current month ." : "The date is not in the current month ." ); </script> </body> </html>