|
| JAVASCRIPT setUTCDay() METHOD
The setUTCDay() method in javascript sets the day in UTC (Universal Coordinated Time). Takes a required numeric value from 0 to 6 as its argument. 0 is for Sunday right through 6 for Saturday.
The general format is:
dateObject.setUTCDay(value);
If you want to return the full date and time with the setUTCDay() method, you will first have to create a new date object and then use the new date object with the setUTCDay() method.
Example:
<script type="text/javascript">
var dd=new Date(); // creates a new date object
dd.setUTCDay(2); // sets day to 2 of current week
document.write(dd); // outputs the date
</script>
The above will output:
See Also:
|
|