JavaScript Date setDate()

The JavaScript date setDate() method sets the date value for a particular date on the basis of local time. Syntax: dateObj.setDate(new_Date); Parameters: new_Date: Integer value between 1 to 31. Example: <!DOCTYPE html> <html> <body> <script> var bday =new Date(“March 13, 1987 21:00:10”); document.writeln(bday.getDate() + “<br>”); bday.setDate(23); document.writeln(bday.getDate()); </script> </body> </html>

JavaScript Date getUTCSeconds()

The JavaScript date getUTCSeconds() method is used to get the integer value between 0 and 59 that represents the seconds on the basis of universal time. Syntax: dateObj.getUTCSeconds() Return: An integer value between 0 and 59. Example: <!DOCTYPE html> <html> <body> <script> var today = new Date(); document.writeln(today.getUTCSeconds()); </script> </body> </html>

JavaScript Date getUTCMonth()

The JavaScript date getUTCMonth() method is used to get the integer value between 0 and 11 that represents the month on the basis of universal time. Syntax: dateObj.getUTCMonth() Return: An integer value between 0 and 11. Example: <!DOCTYPE html> <html> <body> <script> var today = new Date(); document.writeln(today.getUTCMonth()+1); </script> </body> </html>

JavaScript Date getUTCMinutes()

The JavaScript date getUTCMinutes() method is used to get the integer value between 0 and 59 that represents the minutes on the basis of universal time. Syntax: dateObj.getUTCMinutes() Return: An integer value between 0 and 59. Example: <!DOCTYPE html> <html> <body> <script> var today = new Date(); document.writeln(today.getUTCMinutes()); </script> </body> </html>

JavaScript Date getUTCHours()

The JavaScript date getUTCHours() method is used to get the integer value between 0 and 23 that represents the hours on the basis of universal time. Syntax: dateObj.getUTCHours() Return: An integer value between 0 and 23. Example: <!DOCTYPE html> <html> <body> <script> var today = new Date(); document.writeln(today.getUTCHours()); </script> </body> </html>

JavaScript Date getUTCFullYear()

The JavaScript date getUTCFullYear() method is used to get the integer value that represents the year on the basis of universal time. Syntax: dateObj.getUTCFullYear() Return: An integer value that represents a year. Example: <!DOCTYPE html> <html> <body> <script> var today = new Date(); document.writeln(today.getUTCFullYear()); </script> </body> </html>

JavaScript Date getUTCDay()

The JavaScript date getUTCDay() method is used to get the integer value between 0 and 6 that represents the day of the week based on the universal time. Syntax: dateObj.getUTCDay() Return: An integer value between 0 and 6. Example: <!DOCTYPE html> <html> <body> <script> var a = [100,40,678,435,890]; var greatest = Math.max.apply(null, a); document.writeln(greatest); </script> … Read more

JavaScript Date getUTCDate()

The JavaScript date getUTCDate() method is used to get the integer value between 1 and 31 that represents the day for the particular date based on the universal time. Syntax: dateObj.getUTCDate() Return: An integer value between 1 and 31. Example: <!DOCTYPE html> <html> <body> <script> var today = new Date(); document.writeln(today.getUTCDate()); </script> </body> </html>

JavaScript Date getSeconds()

The JavaScript date getSeconds() method is used to get the integer value between 0 and 59 that represents the seconds based on the local time. Syntax: dateObj.getSeconds() Return: An integer value between 0 and 59. Example: <!DOCTYPE html> <html> <body> <script> var d = new Date(“March 16, 2018 13:34:45:500”); var n = d.getSeconds(); document.writeln(n) </script> … Read more

JavaScript Date getMonth()

The JavaScript date getMonth() method is used to get the integer value between 0 and 11 that represents the month based on the local time. Syntax: dateObj.getMonth() Return: An integer value between 0 and 11. Example: <!DOCTYPE html> <html> <body> <script> var d = new Date(“March 16, 2018 13:34:45:500”); var n = d.getMonth()+1; document.writeln(n) </script> … Read more