getutcdate()_日期getUTCDate()方法以及JavaScript中的示例

news/2024/7/19 14:07:49 标签: java, javascript, python, css, js

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

参考: JavaScript getUTCDate()方法

翻译自: https://www.includehelp.com/code-snippets/date-getUTCDate-method-with-example-in-javascript.aspx

getutcdate()


http://www.niftyadmin.cn/n/1255993.html

相关文章

Definition of ‘blow up‘ in the context of PDEs

At one extreme, there are very dramatic examples of illposedness, such as blowup - various norms going to infinity in finite time - beyond which no reasonably strong notion of solution can be salvaged. 摘自Terence Tao的Nonlinear Dispersive Equations里3.8节…

Python流程控制和缩进

我们语文学写作文&#xff0c;有如果… …&#xff0c;那么… …的句式&#xff0c;同样Python也有这样的句式&#xff1b; #如何这个条件成立了&#xff0c;那就执行下面这个语句 if 条件&#xff1a;内容1内容2 else:内容3 几点说明&#xff1a; 转载于:https://www.cnblogs.…

Java RandomAccessFile readUnsignedByte()方法与示例

RandomAccessFile类readUnsignedByte()方法 (RandomAccessFile Class readUnsignedByte() method) readUnsignedByte() method is available in java.io package. readUnsignedByte()方法在java.io包中可用。 readUnsignedByte() method is used to read unsigned 8-bit byte v…

GO功能注释-简单快速

参考&#xff1a;https://www.cnblogs.com/xiaojikuaipao/p/7190779.html https://blog.csdn.net/ygyxl/article/details/79742751 GO 注释主要有两种方法&#xff1a;序列相似性比对&#xff08;BLAST&#xff09;和结构域相似性比对&#xff08;InterProScan&#xff09; 1…

java getname_Java Thread类的最终String getName()方法(带示例)

java getname线程类最终字符串getName() (Thread Class final String getName()) This method is available in package java.lang.Thread.getName(). 软件包java.lang.Thread.getName()中提供了此方法。 This method is used to return the name of this thread. 此方法用于返…

大数据入门_Hadoop环境配置

1、安装虚拟机 VMware workstation CentOS 镜像 安装Linux虚拟机&#xff1a;&#xff08;在Win7上&#xff09; 1&#xff09;安装VMwareWorkstations&#xff08;可修改配置&#xff09; 2&#xff09;添加CentOS镜像&#xff08;启动安装 ->配置网络&#xff09; 网络配置…

C#Convert.ToInt32(double)方法-将double值转换为int

C&#xff03;Convert.ToInt32(double)方法 (C# Convert.ToInt32(double) Method) Convert.ToInt32(double) Method is used to convert a specific double value (a double precision floating point number) to its equivalent integer (int 32 bytes signed number). Conver…

如何在JavaScript中为元素添加类名?

Adding class names using JavaScript can be often used to give certain functionalities to your web application. In this article, we will learn how to add class names to elements on the DOM through JavaScript? 使用JavaScript添加类名称通常可用于为您的Web应用…