Answers for "get only date and not time in js"

5

javascript get date without time

function WithoutTime(dateTime) {
    var date = new Date(dateTime.getTime());
    date.setHours(0, 0, 0, 0);
    return date;
}
Posted by: Guest on July-10-2020
0

js display only date

var newDate = new Date(oldDate.toDateString());
Posted by: Guest on August-06-2021

Code answers related to "get only date and not time in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language