


The JavaScript method getUTCDate() returns a day of the month (UTC) based on Universal Time
Nov 06, 2017 pm 01:13 PMDefinition and Usage
The getUTCDate() method returns the day of the month (UTC) based on Universal Time.
Syntax
dateObject.getUTCDate()
Return value
dateObject When expressed in universal time, returns the day of the month (a value from 1 to 31).
Tips and Comments:
Comments: This method is always used in conjunction with a Date object.
Tip: For more information about Universal Coordinated Time (UTC), please refer to Baidu Encyclopedia.
Example
Example 1
In this example, we will output the current day of this appointment according to UTC:
<script type="text/javascript"> var d = new Date() document.write(d.getUTCDate()) </script>
Output:
6
Example 2
We define a variable with a specific date here, and then output the day of the month in the variable according to UTC:
<script type="text/javascript"> var birthday = new Date("July 21, 1983 01:15:00") document.write(birthday.getUTCDate()) </script>
Output:
21
JavaScript Date.getUTCDate() method returns the day of the month on the specified date according to universal time. The value returned by getUTCDate is an integer between 1 and 31.
Example:
<html> <head> <title>JavaScript getUTCDate Method</title> </head> <body> <script type="text/javascript"> var dt = new Date( "December 25, 1995 23:15:20" ); document.write("getUTCDate() : " + dt.getUTCDate() ); </script> </body> </html>
This will produce the following results for India time zone:
getUTCDate() : 25
The above is the detailed content of The JavaScript method getUTCDate() returns a day of the month (UTC) based on Universal Time. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to implement an online speech recognition system using WebSocket and JavaScript

Recommended: Excellent JS open source face detection and recognition project

Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts

How to implement an online reservation system using WebSocket and JavaScript

How to use JavaScript and WebSocket to implement a real-time online ordering system

Simple JavaScript Tutorial: How to Get HTTP Status Code
