How to use JavaScript's getday method

藏色散人
Release: 2021-11-08 14:21:12
Original
4583 people have browsed it

JavaScript's getday method is used to specify the day of the week. Its usage syntax is "Date.getDay()". If the return value is 0, it means Sunday, if it is 1, it means Monday, and so on.

How to use JavaScript's getday method

The operating environment of this article: windows7 system, javascript version 1.8.5, Dell G3 computer.

How to use JavaScript’s getday method?

getDay() method returns the day of the week (from 0 to 6) for the specified date.

Note: Sunday is 0, Monday is 1, and so on.

Syntax

Date.getDay()
Copy after login

Parameters: No parameters.

Return value: Numeric value, from 0 to 6, indicating the day of the week.

Code example:

   

单击该按钮可显示今天是星期几。

Copy after login

[Recommended learning:javascript basic tutorial]

The above is the detailed content of How to use JavaScript's getday method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!