Commonly used built-in objects

Create a Date object methods

new Date()

new Date(month dd,yyyy hh:mm:ss)

new Date(yyyy,mth,dd,hh,mm,ss)

new Date(yyyy,mth,dd)

new Date(ms)

Date target acquisition time details of the method:

getDate()

Returns a day (1 to 31) of the month from the Date object

getDay()

Returns a day (0-6) of the week from the Date object

getMonth()

Date object returns the month (0-11)

getFullYear()

Date object to return a four-digit year

getHours()

Date object hr (0 to 23)

getMinutes()

Date object minutes (0 to 59)

getSeconds()

Date object seconds (0 to 59)

getTime()

It returns the number of milliseconds January 1, 1970 to date

Set Time Date object methods:

setDate()

Date object set day of the month (1 to 31)

setMonth()

Month Date object set (0 to 11)

setFullYear ()

Date object of the year (four digits)

setHours ()

Date object disposed h (0 to 23)

setMinutes()

Date object in minutes (0 to 59)

setSeconds()

Date object in seconds (0 to 59)

setMilliseconds()

Set Date object ms (0 to 999)

Common methods of the Math object:

abs(x)

Returns the absolute value of the number of

ceil(x)

Logarithm rounded up

floor(x)

To be rounded down number

max(x,y)

Returns the maximum x and y values ​​of

min (x, y)

Returns the lowest value of x and y in

pow (x, y)

Return x to the power y

random()

Returns a random number between 0 and 1

round(x)

The number rounded to the nearest integer

sqrt(x)

Returns the square root of the number of

Guess you like

Origin www.cnblogs.com/sy130908/p/11161655.html