Easy Tutorial
❮ Event Ondragend Prop Style Perspectiveorigin ❯

JavaScript setUTCDate() Method

JavaScript Date Object

Example

Set a day of the month according to Coordinated Universal Time (UTC):

d output result:


Definition and Usage

The setUTCDate() method is used to set the day of the month for a specified date according to Coordinated Universal Time (UTC).

Tip: Coordinated Universal Time (UTC), also known as Universal Coordinated Time, World Standard Time, and International Coordinated Time, is abbreviated as UTC.

Note: UTC time is the same as GMT (Greenwich Mean Time).


Browser Support

All major browsers support the setUTCDate() method.


Syntax

Parameter Values

Parameter Description
day Required. The day of the month to be set for the dateObject, specified in UTC. This parameter is an integer between 1 and 31: 0 is the last day of the previous month<br> -1 is the day before the last day of the previous month If the current month has 31 days: 32 is the first day of the next month If the current month has 30 days: 32 is the second day of the next month

Return Value

Type Description
Number The number of milliseconds from January 1, 1970, to the adjusted date.

Technical Details

| JavaScript Version: | 1.3 | | --- | --- |


More Examples

Example

Set the date to the last day of the previous month:

d output result:

Example

Set a day of the month:

d output result:


JavaScript Date Object

❮ Event Ondragend Prop Style Perspectiveorigin ❯