I'm working on a project where I need to get the hours and minutes alone without the semicolon (:) separating them, and represent them in a variable, myTime
, as a 4-digit number. Here is my code:
var now = new Date();
var time = now.toString().substr(16,5)