Javascript examples for Date Operation:Timestamp
Convert a time to javascript-timestamps
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*ww w. ja v a2 s . com*/ var sTime = '11:23'; var oDate = new Date(); oDate.setHours( parseInt(sTime.substr(0, 2), 10), parseInt(sTime.substr(3, 2), 10), 0, 0 ); var sTimestamp = oDate.getTime(); console.log(sTimestamp); } </script> </head> <body> </body> </html>