Usage of the getDay () method in JavaScript
This article mainly introduces how to use the getDay () method in JavaScript. It is the basic knowledge in JS beginners. If you need it, refer
The javascript Date. getDay () method returns the day of the week as the specified Date according to the local time. The value returned by getDay is an integer corresponding to the day of the week: 0 represents Sunday, 1 represents Monday, 2 represents Tuesday, and so on.
Syntax
?
The following is the detailed information about the parameters:
NA
Return Value:
Returns the day of the week as the specified date based on the local time.
Example:
?
1 2 3 4 5 6 7 8 9 10 11 |
<Html> <Head> <Title> JavaScript getDay Method </title> </Head> <Body> <Script type = "text/javascript"> Var dt = new Date ("December 25,199 5 23:15:00 "); Document. write ("getDay ():" + dt. getDay ()); </Script> </Body> </Html> |
This produces the following results:
?