Javascript examples for String Operation:String Convert
Convert date time to String
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {// w ww. ja v a 2 s .c o m var d = new Date(); var _day = d.getDay(); var _month = d.getMonth() + 1; //months are zero based var _year = d.getFullYear(); var str = _day + "-" + _month + "-" + _year + " 00:00:00"; console.log(str); }); </script> </head> <body> </body> </html>