HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Click the button to display the date as a string.</p> <button onclick="myFunction()">Display Local Date</button> <p id="point"></p> <script> function myFunction() { var d = new Date(); var n = "USA - " + d.toLocaleDateString('en-US'); n += "<br> Italy - " + d.toLocaleDateString('it-IT'); n += "<br> Arab - " + d.toLocaleDateString('ar-EG'); document.getElementById("point").innerHTML = n; } </script> </body> </html>
OUTPUT
×

Save as Private