Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

date split in javascript

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]);
Comment

PREVIOUS NEXT
Code Example
Javascript :: react hook toggle state 
Javascript :: react, scroll element into view 
Javascript :: vue get store state 
Javascript :: Add event listener for loop 
Javascript :: try catch in node js 
Javascript :: set cursor type javascript 
Javascript :: how to sum two var in jquery 
Javascript :: efi javascript 
Javascript :: keypress javascript 
Javascript :: play audio javascript 
Javascript :: how to pretty formatjson value on terminal ruby 
Javascript :: remove first and last character javascript 
Javascript :: disable submit button until checkbox is checked javascript 
Javascript :: fs append 
Javascript :: how to run nextjs in another port 
Javascript :: js check tab active 
Javascript :: get id of first td jquery 
Javascript :: js get date in ms 
Javascript :: random integer in nodejs 
Javascript :: javascript string contains multiple substrings 
Javascript :: javascript ES6 destructure dynamic property name 
Javascript :: jquery validation phone number 
Javascript :: javascript innerwidth 
Javascript :: draw image onto canvas js 
Javascript :: js foreach .childern 
Javascript :: array of refs react 
Javascript :: javascript remove characters from beginning of string 
Javascript :: json.stringify parameters 
Javascript :: two decimel javascript 
Javascript :: angular elementref 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =