Displaying Date with formatWe can display the present day of the week by using getDay function of the JavaScript date object. Here getDay function will return 0 to 6 based on the day. Number 0 will be returned for Sunday and 1 for Monday.We will create one day array with all the names of the seven days will be stored. Based on the value returned by getDay function the name of the day will be displayed from the array. Here is the demo of the getDay function. Here is the full code of the above demo.
Date Project on getting Second Saturday of the monthDate Project on getting week dayUser can enter any date in mm/dd/yy format and get the day of the week for that date.
This article is written by plus2net.com team.
![]() | ||||||||
▼ More on JavaScript Date
| ||||||||