screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script> function getDayFromDate() { const date = new Date('2024-02-20'); const dayOfWeek = date.getDay(); const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; const dayName = daysOfWeek[dayOfWeek]; document.getElementById('output').textContent = dayName; } </script> </head> <body> <h1>Javascript Get Day from Date</h1> <p>Date :2024-02-20 </p> <p id="output"></p> <button onclick="getDayFromDate()">Clikc me to Get Day</button> </body> </html>