Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Try the following code

XML
<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var d = new Date(2014,12,24,11,33,30,0);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>



produce result as

Sat Jan 24 2015 11:33:30 GMT+0530 (India Standard Time).

Please have a look and comment.
Posted
Updated 1-Jan-15 19:45pm
v2

1 solution

Month is from 0 to 11. So, 11 is for December.

New code is...
JavaScript
var d = new Date(2014, 11, 24, 11, 33, 30, 0);
document.getElementById("demo").innerHTML = d;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900