JavaScript getUTCDate function is one of the Date Function, which returns the day of the month on a given date according to universal time.
JavaScript getUTCDate Function Example
In this example, we are using getUTCDate to return the day number of the month in the current date and time.
<!DOCTYPE html> <html> <head> <title> JavaScript Get UTC Date Function </title> </head> <body> <h1> Example </h1> <script> var dt = Date(); document.write("Date and Time : " + dt); document.write("UTC Date : " + dt.getUTCDate()); </script> </body> </html>
Example
Date and Time: Sun Nov 04 2018 16:30:02 GMT+0530 (Indian Standard Time)
UTC Date : 4
JavaScript get UTC Date Function Example
In this JavaScript getUTCDate function, we are displaying the day number from the custom date
<!DOCTYPE html> <html> <head> <title> JavaScript Get UTC Date Function </title> </head> <body> <h1> JavaScript get UTC Date Function Example </h1> <script> var dt = Date("December 14, 2016 11:22:34"); document.write("Date and Time : " + dt); document.write("UTC Date using getUTCDate(): " + dt.getUTCDate()); </script> </body> </html>
