Saturday, 31 August 2013

toISOString() return wrong date

toISOString() return wrong date

Hy this piece of code return the tomorrow date ?
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_toisostring
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to display the date and time as a string,
using the ISO standard.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var d = new Date();
var x = document.getElementById("demo");
x.innerHTML=d.toISOString();
}
</script>
</body>
</html>

No comments:

Post a Comment