getutcdate()
JavaScript日期getUTCDate()方法 (JavaScript Date getUTCDate() method)
getUTCDate() method is a Date's class method and it is used to get the current day of the month according to the UTC (Universal time coordinated).
getUTCDate()方法是Date的类方法,用于根据UTC(协调世界时)获取当月的当前日期。
Syntax:
句法:
var dt = new Date();
dt.getUTCDate();
Examples:
例子:
Input:
var dt = new Date();
dt.getUTCDate();
Output:
8
JavaScript code to get the current UTC day of the month using getUTCDate() method
使用getUTCDate()方法获取当前UTC月份JavaScript代码
<html>
<head><title>JavaScipt Example</title></head>
<body>
<script>
var dt = new Date(); //Date constructor
var day1 = dt.getUTCDate(); //UTC day
var day2 = dt.getDate(); //local day
//printing day of the month
document.write("UTC day = " + day1 + "<br>");
document.write("Local day = " + day2 + "<br>");
</script>
</body>
</html>
Output
输出量
UTC day = 8
Local day = 8
Reference: JavaScript getUTCDate() Method
翻译自: https://www.includehelp.com/code-snippets/date-getUTCDate-method-with-example-in-javascript.aspx
getutcdate()