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