valueOf (Date - JavaScript)

Gets the date as a numeric value.

Defined in

Date (Standard - JavaScript)

Syntax

valueOf() : string
Return value Description
string The numeric value of the date converted to a string.

Examples

This computed label returns 0.0 because the date is set to the base date 0 hours, January 1, 1970 UTC.
var date = new Date();
date.setUTCFullYear(1970, 0, 1);
date.setUTCHours(0, 0, 0, 0);
date.valueOf()