Get name of day in week using Javascript

ar = new Array(7)
ar[0] = " Sunday"
ar[1] = " Monday"
ar[2] = " Tuesday"
ar[3] = " Wednesday"
ar[4] = " Thursday"
ar[5] = " Fri day"
ar[6] = " Saturday"
var someday = new Date(" January 3, 1987" )
var day = someday. getDay()
alert(" The day is " + ar[day] )

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.