Share via


getUTCMilliseconds 方法

更新:2007 年 11 月

使用 Coordinated Universal Time (UTC) 傳回 Date 物件中的毫秒值。

 function getUTCMilliseconds() : Number

備註

若要取得本地時間的毫秒數,請使用 getMilliseconds 方法。

傳回的毫秒值可以介於 0 到 999 之間。

範例

下列範例說明如何使用 getUTCMilliseconds 方法。

function UTCTimeDemo(){
   var d, s = "Current Coordinated Universal Time (UTC) is: ";
   var c = ":";
   d = new Date();
   s += d.getUTCHours() + c;
   s += d.getUTCMinutes() + c;
   s += d.getUTCSeconds() + c;
   s += d.getUTCMilliseconds();
   return(s);
}

需求

3 版

套用至:

Date 物件

請參閱

參考

getMilliseconds 方法

setMilliseconds 方法

ssetUTCMilliseconds 方法