Display the Current Day of the Week

Demonstrates how to display the current day of the week.

<script language="javascript">
var DayOfWeek;
function fncDayOfWeek()
{
var stDate;
var now;
var assoc= new Array(7);
assoc[0]="Sunday";
assoc[1]="Monday";
assoc[2]="Tuesday";
assoc[3]="Wednesday";
assoc[4]="Thursday";
assoc[5]="Friday";
assoc[6]="Saturday";
now= new Date();
stDate=now.getDay();
return(assoc[stDate]);
}

document.write('<B>Current Day of the Week:</b>' + DayOfWeek);

</script>

You might also like...

Comments

David Nishimoto NishiSoft provides Part I of the Information Technology Project collaboration. Sign up and list your IT project tasks, assign task too friends, and get percent complete task. Part will include a wo...

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only two kinds of languages: the ones people complain about and the ones nobody uses” - Bjarne Stroustrup