JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

Date.getTime()

Date.getTime()


return a Date in milliseconds

Synopsis

date.getTime()

Returns

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

Date.getUTCDate()

Description

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. Note that the millisecond representation of a date is independent of the time zone, so there is no getUTCTime() method in addition to this one. Don’t confuse this getTime() method with the getDay() and getDate() methods, which return the day of the week and the day of the month, respectively.

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

See Also

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

Date.getTimezoneOffset()

determine the offset from GMT

Synopsis

date.getTimezoneOffset()

Returns

The difference, in minutes, between GMT and local time.

Description

getTimezoneOffset() returns the number of minutes difference between the GMT or UTC time and the local time. In effect, this function tells you what time zone the JavaScript code is running in and whether or not daylight saving time is (or would be) in effect at the specified date.

The return value is measured in minutes, rather than hours, because some countries have time zones that are not at even one-hour intervals.

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/28153.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1