JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next
 

Date.getTime() Method

Name

Date.getTime() Method---return a Date in milliseconds

Availability

Navigator 2.0, Internet Explorer 3.0

Synopsis

date.getTime()

Arguments

none

Returns

The millisecond representation of the specified Date object date. That is, this method returns the number of milliseconds between midnight (GMT) on 1/1/1970 and the date and time specified by date.

Usage

getTime() converts a date and time to a single integer. This is useful when you want to compare two Date objects or to determine the time elapsed between two dates.

Date.parse() and Date.UTC() allow you to convert a date and time specification to millisecond representation without going through the overhead of first creating a Date object.

See Also

"Date", "Date.parse()", "Date.setTime()", "Date.UTC()"


Previous Home Next
Date.getSeconds() Book Index Date.getTimezoneOffset()

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell
Hosted by uCoz