How to get the day of the week in JavaScript?

JavascriptWeb DevelopmentFront End Technology

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.


You can try to run the following code to get the day of the week in JavaScript −

Live Demo

      <title>JavaScript getDay Method</title>
         var dt = new Date("December 25, 1995 23:15:00");
         document.write("Day of the week: " + dt.getDay() );


Day of the week: 1
Published on 13-Feb-2018 08:29:29