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

JavaScript Date getMinutes()

The JavaScript date getMinutes() method is used to get the integer value between 0 and 59 that represents the minutes based on the local time. Syntax: dateObj.getMinutes() 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.getMinutes(); document.writeln(n) </script> … Read more

JavaScript Date getMilliseconds()

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

JavaScript Date getHours()

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

JavaScript Date getFullYear()

The JavaScript date getFullYear() method is used to return the integer value that represents the year based on the local time. Syntax: dateObj.getFullYear() Return: An integer value that represents a year. Example: <!DOCTYPE html> <html> <body> <script> var bday = new Date(“March 16, 2018 21:00:10”); document.writeln(bday.getFullYear()) </script> </body> </html>

JavaScript Date getDay()

The JavaScript date getDay() method is used to get the integer value between 0 and 6 that represents the day of the week based on the local time. Syntax: dateObj.getDay() Return: An integer value between 0 and 6. Example: <!DOCTYPE html> <html> <body> <script> var bday = new Date(“March 16, 2018 21:00:10”); document.writeln(bday.getDay()) </script> </body> … Read more

JavaScript getDate()

The JavaScript date getDate() method is used to get the integer value between 1 and 31 that represents the day for the particular date on the basis of local time. Syntax: dateObj.getDate() Return: An integer value between 1 and 31. Example: <!DOCTYPE html> <html> <body> <script> var bdate = new Date(“Mrach 16, 2018 21:00:10”); document.writeln(bdate.getDate()) … Read more

JavaScript Date Tutorial

JavaScript facilitates an object especially to get a day, a month, or a year as an output. This object is also called a JavaScript Date object. JavaScript date object constructors Date() Date(milliSeconds) Date(dateString) Date(year, month, day, hours, minutes, seconds, milliSeconds) Example: <html> <body> <script> var date=new Date(); var day=date.getDate(); var month=date.getMonth()+1; var year=date.getFullYear(); document.write(“<br>Today Date: … Read more