Set date to paragraph - Javascript jQuery

Javascript examples for jQuery:Date

Description

Set date to paragraph

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from  ww w  .j ava 2s .com
var string = "2015,5,28,20,10"
var nums = string.replace(/,/g , "");
nums = Number(nums)
var newDate = new Date(nums);
$("p").html(newDate)
    });

      </script> 
   </head> 
   <body> 
      <p></p>  
   </body>
</html>

Related Tutorials