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

Save as Private