请单击以进行评分并提供反馈
MSDN
MSDN Library
JScript
JScript 参考
语言参考
方法 (F-I)
 getMinutes 方法

  开启低带宽视图
此页面仅适用于
Microsoft Visual Studio 2005/.NET Framework 2.0

同时提供下列产品的其他版本:
JScript 8.0
getMinutes 方法

使用当地时间返回 Date 对象中的分钟值。

function getMinutes() : Number

若要使用协调通用时间 (UTC) 获取分钟值,请使用 getUTCMinutes 方法。

getMinutes 方法返回一个介于 0 到 59 之间的整数,该整数等于存储在 Date 对象中的分钟值。两种情况下会返回零:当小时后的时间不足一分钟时,或当创建 Date 对象时未将时间存储在该对象中。而要确定究竟属于哪种情况,唯一的方法就是检查小时和秒值是否也为零值。若它们均为零,则几乎可以肯定未将时间存储在 Date 对象中。

下面的示例阐释了 getMinutes 方法的用法。

function TimeDemo(){
   var d, s = "The current local time is: ";
   var c = ":";
   d = new Date();
   s += d.getHours() + c;
   s += d.getMinutes() + c;
   s += d.getSeconds() + c;
   s += d.getMilliseconds();
   return(s);
}

版本 3

应用于:

社区内容   什么是社区内容?
添加新内容 RSS  批注
Processing
© 2009 Microsoft Corporation 版权所有。 保留所有权利  |  商标  |  隐私权声明
Page view tracker