
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the day of the week in JavaScript?
To get the day of the week, use the JavaScript getDay() method. JavaScript date getDay() method returns the day of the week for the specified date according to local time. The value returned by getDay() is an integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on.
Example
You can try to run the following code to get the day of the week in JavaScript −
<html> <head> <title>JavaScript getDay Method</title> </head> <body> <script> var dt = new Date("December 25, 1995 23:15:00"); document.write("Day of the week: " + dt.getDay() ); </script> </body> </html>
Output
Day of the week: 1
- Related Questions & Answers
- Get the week number in MySQL for day of week?
- How to get first day of the week using Python?
- Java Program to get the day of the week from GregorianCalendar
- How to get first day of week in PHP?
- Day of the Week in C++
- Python Pandas - Get the Day of the week the period lies in
- In MySQL, how we can compute date by providing the year, week number and day of the week? day of the week?
- Get Day Number of Week in Java
- Python Pandas - Get the day of the week from the PeriodIndex object
- Java Program to get day of week for the last day of each month in 2019
- C# Program to get current day of week
- How to get the day of the month in JavaScript?
- Get the day of week for a particular date in Java
- Get the Day of the Week from Today's Date in Java
- Java Program to get day of week as string
Advertisements