JavaScript valueOf() method

The JavaScript date valueOf() method is used to get the primitive value of a Date object.

Syntax:

dateObj.valueOf();

Return:
Primitive value of a Date object.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var bday=new Date("November 16, 1994 21:10:10");
document.writeln(bday.valueOf());
</script>
</body>
</html>