I am trying to format a String into a 24 hour format using moment JS at the moment I am not getting the expected output, the below explains it in more detail:
How I am coverting
var testFormat = moment("9:00","HH:mm:ss");
I was hoping this would output:
09:00:00 (24 Hour format)
But for some reason is does not convert just the date, this is outputing the following:
1471507200000
Best Answer
You are using it wrong. You can provide a format as the second argument to moment. So in your case it would be:
To get the
moment
. Now you can format it the way you want:DEMO