Answer the question
In order to leave comments, you need to log in
How to parse a date string?
there is a string 2015-10-21 09:35:18 . How to extract hours and minutes from it? Whatever it was 09:35
Answer the question
In order to leave comments, you need to log in
s = '2015-10-21 09:35:18';
d = new Date(s);
console.log(d.getHours(), d.getMinutes());
time = '2015-10-21 09:35:18'.split(' ')[1];
parts = time.split(':');
console.log(parts[0], parts[1]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question