JavaScript setUTCMonth()

The JavaScript date setUTCMonth() method sets the month value for the particular date on the basis of universal time. Syntax: dateObj.setUTCMonth(new_month); Parameters: new_Date: Integer value between 0 to 11. Example: <!DOCTYPE html> <html> <body> <script> var today =new Date(); document.writeln(today.getUTCMonth()+”<br>”); today.setUTCMonth(4); document.writeln(today.getUTCMonth()); </script> </body> </html>

JavaScript setUTCMinutes()

The JavaScript date setUTCMinutes() method sets the minute value for a particular date on the basis of universal time. Syntax: dateObj.setUTCMinutes(new_minutes); Parameters: new_minutes: Integer value between 0 to 59. Example: <!DOCTYPE html> <html> <body> <script> var today =new Date(); document.writeln(today.getUTCMinutes()+”<br>”); today.setUTCMinutes(45); document.writeln(today.getUTCMinutes()); </script> </body> </html>

JavaScript setUTCMilliseconds()

The JavaScript date setUTCMilliseconds() method sets the millisecond value for the particular date on the basis of universal time. Syntax: dateObj.setUTCMilliseconds(new_milliseconds); Parameters: new_milliseconds: Integer value between 0 to 999. If its value is greater than 999 then the second value will increase accordingly. Example: <!DOCTYPE html> <html> <body> <script> var today =new Date(); document.writeln(today.getUTCMilliseconds()+”<br>”); today.setUTCMilliseconds(500); … Read more

JavaScript setUTCHours()

The JavaScript date setUTCHours() method sets the hour value for a particular date on the basis of universal time. Syntax: dateObj.setUTCHours(new_hours); Parameters: new_hours: Integer value between 0 to 23. Example: <!DOCTYPE html> <html> <body> <script> var today =new Date(); document.writeln(today.getUTCHours()+”<br>”); today.setUTCHours(12); document.writeln(today.getUTCHours()); </script> </body> </html>

JavaScript setUTCFullYear()

The JavaScript date setUTCFullYear() method sets the year value for the particular date on the basis of universal time. Syntax: dateObj.setUTCFullYear(new_years); Parameters: new_years: Integer value which represents a year. Example: <!DOCTYPE html> <html> <body> <script> var today =new Date(); document.writeln(today.getUTCFullYear()+”<br>”); today.setUTCFullYear(2019); document.writeln(today.getUTCFullYear()); </script> </body> </html>

JavaScript setUTCDate()

The JavaScript date setUTCDate() method sets the date value for a particular date on the basis of universal time. Syntax: dateObj.setUTCDate(new_date); Parameters: new_Date: Integer value between 1 to 31. Example: <!DOCTYPE html> <html> <body> <script> var today =new Date(); document.writeln(today.getUTCDate()+”<br>”); today.setUTCDate(31); document.writeln(today.getUTCDate()); </script> </body> </html>

JavaScript setSeconds()

The JavaScript date setSeconds() method sets the second value for the particular date on the basis of local time. Syntax: dateObj.setSeconds(new_seconds); Parameters: new_seconds: Integer value between 0 to 59. Example: <!DOCTYPE html> <html> <body> <script> var bday =new Date(“November 16, 1994 21:00:50”); document.writeln(bday.getSeconds() + “<br>”); bday.setSeconds(45); document.writeln(bday.getSeconds()); </script> </body> </html>

JavaScript setMonth()

The JavaScript date setMonth() method sets the month value for the particular date on the basis of local time. Syntax: dateObj.setMonth(new_Month); Parameters: new_Month: Integer value between 0 to 11. Example: <!DOCTYPE html> <html> <body> <script> var bday =new Date(“November 16, 1994 21:00:10”); document.writeln(bday.getMonth() + “<br>”); bday.setMonth(11); document.writeln(bday.getMonth()); </script> </body> </html>

JavaScript setMinutes()

The JavaScript date setMinutes() method sets the minute value for the particular date on the basis of local time. Syntax: dateObj.setMinutes(new_Minutes); Parameters: new_Minutes: Integer value between 0 to 59. Example: <!DOCTYPE html> <html> <body> <script> var bday =new Date(“November 16, 1994 21:00:10”); document.writeln(bday.getMinutes() + “<br>”); bday.setMinutes(24); document.writeln(bday.getMinutes()); </script> </body> </html>

JavaScript setMilliseconds()

The JavaScript date setMilliseconds() method sets the millisecond value for a particular date on the basis of local time. Syntax: dateObj.setMilliseconds(new_milliseconds); Parameters: new_milliseconds: Integer value between 0 to 999. If its value is greater than 999 then the second value will be increased accordingly. Example: <!DOCTYPE html> <html> <body> <script> var bday =new Date(“November 16, … Read more