複製鏈接
請複製以下鏈接發送給好友

getMilliseconds

鎖定
要獲取用全球標準時間 (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);