Prev Demo
JavaScript
>
Toisostring() Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to convert the date of a date object into string, using ISO standard.</p> <input type="button" value="Click" onclick="myDate()" /> <p id="myId"></p> <script> var A = new Date(); //* Returns the date & time as per the internet network *// alert(A); //* Displays the Var A result in the alert box *// function myDate() { var R = A.toISOString(); //* Converts the date of a date object into, string using ISO standard *// document.getElementById("myId").innerHTML = R; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output