JavaScript getUTCMinutes 函数是 Date 函数之一,它根据世界时返回给定日期的总分钟数。getUTCMinutes 函数的语法是:
Date.getUTCMinutes()
我们使用 getUTCMinutes 函数根据世界时从当前日期和时间返回总分钟数。
<!DOCTYPE html>
<html>
<head>
<title> JS </title>
</head>
<body>
<h1> Example </h1>
<script>
var dt = Date();
document.write("Date and Time : " + dt);
document.write("UTC Minutes : " + dt.getUTCMinutes());
</script>
</body>
</html>
Example
Date and Time: Mon Nov 05 2018 11:17:31 GMT+0530 (Indian Standard Time)
UTC Minutes : 47
在此 JavaScript get UTC Minutes 示例中,我们按世界时显示自定义日期和时间的分钟数。
<!DOCTYPE html>
<html>
<head>
<title> JavaScriptGetUTCMinutesFunction </title>
</head>
<body>
<h1> JavaScriptgetUTCMinutesFunctionExample </h1>
<script>
var dt = Date("April 1, 2017 10:12:22");
document.write("Date and Time : " + dt);
document.write("UTC Minutes using getUTCMinutes : " + dt.getUTCMinutes());
</script>
</body>
</html>
