什么是getMilliseconds

核心提示要获取用全球标准时间 (UTC)表示的毫秒值,请使用 getUTCMilliseconds 方法。外文名getMilliseconds返回Date 对象类型毫秒值性质程序getMilliseconds 方法返回 Date 对象中用本地时间表

最佳答案:

要获取用全球标准时间 (UTC)表示的毫秒值,请使用 getUTCMilliseconds 方法。

详情介绍

要获取用全球标准时间 (UTC)表示的毫秒值,请使用 getUTCMilliseconds 方法。

外文名
getMilliseconds
返回
Date 对象
类型
毫秒值
性质
程序

getMilliseconds 方法

返回 Date 对象中用本地时间表示的毫秒值。

dateObj.getMilliseconds()

必选项 dateObj 参数为 Date 对象。

说明

要获取用全球标准时间 (UTC)表示的毫秒值,请使用 getUTCMilliseconds 方法。

所返回的毫秒值处于 0-999 之间。

示例

下面这个例子说明了 getMilliseconds 方法的用法:

function TimeDemo(){

var d, s = "当前本地时间为: ";

var c = ":";

d = new Date();

s += d.getHours() + c;

s += d.getMinutes() + c;

s += d.getSeconds() + c;

s += d.getMilliseconds();

return(s);

}

 
友情链接
鄂ICP备19019357号-22