If the current time is 2:18, the output of the code below is: 2,18. What I would like is 2:18.
Thank you for your consideration and answer!
<script> var today = new Date(); h = today.getHours(); m = today.getMinutes(); z = [h,m]; </script> <button onclick="document.getElementById('demo').innerHTML=z">time</button> <p id="demo"></p>
While there are many better ways to do this, you can use:
I would check out http://momentjs.com/