Date.prototype.setUTCDate()

El m猫tode setUTCDate() assigna el dia del mes per a una data especificada, en temps universal.

Sintaxi

objecteData.setUTCDate(dia)

Par脿metres

dia
Un nombre sencer de 1 a 31, que representa el dia del mes.

Descripci贸

If a parameter you specify is outside of the expected range, setUTCDate() attempts to update the date information in the Date object accordingly. For example, if you use 40 for dayValue, and the month stored in the Date object is June, the day will be changed to 10 and the month will be incremented to July.

Si es passa un par脿metre que est脿 fora del rang esperat, el m猫tode setUTCDate() actualitza els altres par脿metres per a acceptar el nombre. Per exemple, si es passa 40 com a dia, i el mes especificat a l'objecte Date 茅s juny, el dia es canviar脿 a 10 i el mes ser脿 incrementat a juliol.

Exemples

Utilitzar setUTCDate()

var elGranDia = new Date();
elGranDia.setUTCDate(20);

Especificacions

Especificaci贸 Estat Comentaris
ECMAScript 1st Edition (ECMA-262) Standard Definici贸 inicial. Implementat a JavaScript 1.3.
ECMAScript 5.1 (ECMA-262)
The definition of 'Date.prototype.setUTCDate' in that specification.
Standard  
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Date.prototype.setUTCDate' in that specification.
Standard  

Compatibilitat amb navegadors

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help! (en-US)
Caracter铆stica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport b脿sic (Yes) (Yes) (Yes) (Yes) (Yes)
Caracter铆stica Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport b脿sic (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)

Vegeu tamb茅