setUTCSeconds()

このエントリーをはてなブックマークに追加

setUTCSeconds()はDateオブジェクトの秒(UTC)を設定できるメソッドです。

UTCとはUniversal Time, Coordinatedの略で協定世界時間のこと。

var d = new Date();
console.log(d.getUTCSeconds());//57
d.setUTCSeconds(12); 
console.log(d.getUTCSeconds());//12

setUTCSeconds()の引数に設定した秒を指定します。

引数に60以上の値を指定すると、それに応じて分の値も変更されます。

var d = new Date();
console.log(d.getUTCMinutes());//26
d.setUTCSeconds(60); 
console.log(d.getUTCMinutes());//27

登録日 : 2012年11月08日 最終更新日 : 2012年11月8日

同じカテゴリー(Date)のエントリー

検索

スポンサードリンク

バージョン

リファレンス