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

getYear()

getYear() returns the year field of a specified Date object minus 1900. As of ECMAScript v3, it is not required in conforming JavaScript implementations; use getFullYear() instead.


Date.now() ECMAScript 5

return the current time in milliseconds

Synopsis

Date.now()

Returns

The current time, in milliseconds since midnight GMT on January 1, 1970.

Description

Prior to ECMAScript 5, you can implement this method like this:

Date.now = function() { return (new Date()).getTime(); }

See Also

Date , Date.getTime()

Date.parse()

parse a date/time string

Synopsis

Date.parse(date)

Arguments

date

A string containing the date and time to be parsed.

Returns

The number of milliseconds between the specified date and time and midnight GMT on January 1, 1970.

Description

Date.parse()is a static method of Date. It parses the date specified by its single string argument returns it as the number of milliseconds since the epoch. This return value can be used directly, used to create a new Date object, or used to set the date in an existing Date object with Date.setTime().

ECMAScript 5 requires this method to be able to parse strings returned by the Date.toISO String() method. In ECMAScript 5 and before, this method is also required to be able to

Date.setFullYear()

parse the implementation-dependent strings returned by the toUTCString() and toString() methods.

See Also

Date , Date.setTime() , Date.toISOString() , Date.toString()

Date.setDate()

set the day-of-the-month field of a Date

Synopsis

date.setDate(day_of_month)

Arguments

day_of_month

An integer between 1 and 31 that is used as the new value (in local time) of the day-ofthe-month field of date.

Returns

The millisecond representation of the adjusted date. Prior to ECMAScript standardization, this method returns nothing.

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