I have a date string and try to parse it use moment.js:
var d = '06/09/2015 200AM';
var date = moment(d, 'MM/DD/YYYY hmmA');
However, the hour seems not right after parsing:
console.error(date.hours); //output: 20
Am I doing anything wrong here?
I guess if hour and minute are separated by a ':' would solve the problem, but the time was get from value of a and I don't like to put the ':' in it..
Thanks for all the help.
That's a very odd string format, one would normally expect a reliable two digits for that hour value. I think you're going to have to pre-process it.