Get UTC Day of Week Method

The Get UTC Day of Week method returns the UTC day of the week of a date object as a number from 0 through 6. For more information, see Values for Dates and Times.

Format

dateVar.getUTCDay()

The following example displays the day of the week for May 1, 2005 in local time and in UTC time:

function Button2_Click ()
{
   var localDay;

   var UTCDay;

   var MayDay = new Date("May 1, 2005 13:30:35");

   var weekDay = new Array("Sunday", "Monday", "Tuesday",

   "Wednesday", "Thursday", "Friday", "Saturday");
   for (var i = 0; i <= MayDay.getDay();i++)
   localDay = weekDay[i];

   var msgtext = "May 1, 2005, 1:30 PM falls on " + localDay;
   for  (var j = 0; j <= MayDay.getUTCDay(); j++)

      UTCDay = weekDay[j];

   msgtext = msgtext + " locally, \nand on " + UTCDay + " GMT.";
   TheApplication().RaiseErrorText(msgtext);
}