Start timer with mention time and date using js

Start timer with mention time and date using js

Hello all,

I have been trying to get the timer set with the mention date and time. 
Below is the code i tried so far.

  1. <html>
  2. <head>
  3. <title></title>
  4. </head>
  5. <body onload="timer();">
  6. <script type="text/javascript">
  7. function timer() {
  8.    var now = new Date();
  9.    var outStr = now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
  10.    document.getElementById('clockDiv').innerHTML=outStr;
  11.    setTimeout('timer()',1000);
  12. }
  13. timer();
  14. </script>   
  15. <div id="clockDiv"></div>
  16. </body>
  17. </html>

The above code gives the output of system date but i want to specify the date and the timer should start from that day itself.

Example: I tried adding date and time in the new date() as below:
  1. var now = new Date('Wed, 15 May 2013 13:05:32');

But then the timer doesn't work.

Could someone please help me out here?