0
var date = '11/19/2017';
var dsplit = date.split('/');
var myDate = new Date(dsplit[2], dsplit[1]-1, dsplit[0]);

this will give me result of

Sun Nov 19 2017 00:00:00 GMT+0800 (+08)

How can i turn it to just

Nov 19 2017
  • 1
    The linked duplicate gives lots of ways to format a `Date` object, once you've created a date object with `new Date()`. Or for your particular case there are ways to do it without using a `Date` object at all, e.g.: `'11/19/2017'.replace(/(\d+)\/(\d+)\/(\d+)/, function(_, m, d, y) { return ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][m-1]+' '+d+' '+y })`. – nnnnnn Oct 12 '17 at 01:55

0 Answers0