dateObject.setUTCMilliseconds( milliSecondsValue )メソッドは、Dateオブジェクトの協定世界時に基づく日時の何ミリ秒かを設定するメソッド。
構文
dateObject.setUTCMilliseconds( milliSecondsValue )
引数
- milliSecondsValue
- Dateオブジェクトの協定世界時に基づく日時のミリ秒を、「0~999」の数値で指定する。
サンプル
<script type="text/javascript">
var $dateObject = new Date( "2013-05-03T13:25:30.500" );
document.write( $dateObject.getUTCFullYear() + '年' );
document.write( $dateObject.getUTCMonth()+1 + '月' );
document.write( $dateObject.getUTCDate() + '日' );
document.write( $dateObject.getUTCHours() + '時' );
document.write( $dateObject.getUTCMinutes() + '分' );
document.write( $dateObject.getUTCSeconds() + '秒' );
document.write( $dateObject.getUTCMilliseconds() + 'ミリ秒<br />' );
$dateObject.setUTCMilliseconds( 999 );
document.write( '「$dateObject.setUTCMilliseconds( 999 )」で何ミリ秒かを設定すると、<br />' );
document.write( $dateObject.getUTCFullYear() + '年' );
document.write( $dateObject.getUTCMonth()+1 + '月' );
document.write( $dateObject.getUTCDate() + '日' );
document.write( $dateObject.getUTCHours() + '時' );
document.write( $dateObject.getUTCMinutes() + '分' );
document.write( $dateObject.getUTCSeconds() + '秒' );
document.write( $dateObject.getUTCMilliseconds() + 'ミリ秒<br />' );
</script>
var $dateObject = new Date( "2013-05-03T13:25:30.500" );
document.write( $dateObject.getUTCFullYear() + '年' );
document.write( $dateObject.getUTCMonth()+1 + '月' );
document.write( $dateObject.getUTCDate() + '日' );
document.write( $dateObject.getUTCHours() + '時' );
document.write( $dateObject.getUTCMinutes() + '分' );
document.write( $dateObject.getUTCSeconds() + '秒' );
document.write( $dateObject.getUTCMilliseconds() + 'ミリ秒<br />' );
$dateObject.setUTCMilliseconds( 999 );
document.write( '「$dateObject.setUTCMilliseconds( 999 )」で何ミリ秒かを設定すると、<br />' );
document.write( $dateObject.getUTCFullYear() + '年' );
document.write( $dateObject.getUTCMonth()+1 + '月' );
document.write( $dateObject.getUTCDate() + '日' );
document.write( $dateObject.getUTCHours() + '時' );
document.write( $dateObject.getUTCMinutes() + '分' );
document.write( $dateObject.getUTCSeconds() + '秒' );
document.write( $dateObject.getUTCMilliseconds() + 'ミリ秒<br />' );
</script>
↓↓↓出力結果↓↓↓