Date toLocaleDateString()
toLocaleDateString() displays the date's day of the week, month, day of the month, and year.
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
var aDate = new Date(Date.UTC(2021, 5, 4, 12, 21, 55));
document.writeln(aDate.toLocaleDateString());
</script>
</head>
<body>
</body>
</html>