dateObj.getSeconds()
dateObj:必選,Date 物件。getHours()、getMinutes() 是否皆為 0。取得 UTC 秒數請用 getUTCSeconds()。
function TimeDemo() {
var d = new Date();
var s = "當前本地時間: ";
var c = ":";
s += d.getHours() + c;
s += d.getMinutes() + c;
s += d.getSeconds() + c;
s += d.getMilliseconds();
return s;
}