var date = "28st December,2016"; var date_split1 = date.split(' '); var date_split2 = date_split1[1].split(','); console.log('date: ', date_split1[0]); console.log('month: ', date_split2[0]); console.log('year: ', date_split2[1]);