getUTCMilliseconds 方法
返回 Date 对象中用 全球标准时间 (UTC) 表示的毫秒值。 dateObj. getUTCMilliseconds() 必选项 dateObj 参数为 Date 对象。 说明 要获取用 本地时间 表示的毫秒数,请使用 getMilliseconds 方法。 返回的
返回 Date 对象中用全球标准时间 (UTC)表示的毫秒值。
dateObj.getUTCMilliseconds()
必选项 dateObj 参数为 Date 对象。
说明
要获取用本地时间表示的毫秒数,请使用 getMilliseconds 方法。
返回的毫秒值的范围是 0-999。
示例
下面这个例子说明了 getUTCMilliseconds 方法的用法。
function UTCTimeDemo(){ var d, s = "
当前全球标准时间(UTC)
是: ";
var c = ":";
d = new Date();
s += d.getUTCHours() + c;
s += d.getUTCMinutes() + c;
s += d.getUTCSeconds() + c;
s += d.getUTCMilliseconds();
return(s);
}
- 上一篇:toTimeString 方法
- 下一篇:getUTCMinutes 方法
精彩图集
精彩文章