JavaScript Tutorial/Date/getTime

Материал из Web эксперт
Версия от 21:52, 25 мая 2010; (обсуждение)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Date.getTime()

The getTime() method returns the equivalence of the Date object in milliseconds.

The milliseconds are expressed as an integer representing the number of milliseconds between midnight January 1, 1970 (GMT) to the date and time specified in the Date object.

It is much easier to compare two different dates as milliseconds by using the getTime() method, rather than having to examine the individual parts of the date.



   <source lang="javascript">

<html> <head> <title>A Simple Page</title> <script language="JavaScript">

</script> </head> <body> </body> </html></source>