remove time from date javascript 1

remove time from date javascript

var d = '12/12/1955 12:00:00 AM';
d = d.split(' ')[0];
console.log(d);

Here is what the above code is Doing:
1. It’s splitting the string into an array of strings, using the space character as the delimiter.
2. It’s taking the first element of the array, which is the date.
3. It’s printing the date.

Similar Posts