Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
setTime() は Date インスタンスのメソッドで、この日付のタイムスタンプを変更します。これは、 UTC の 1970 年 1 月 1 日午前 0 時を元期として定義される、元期からのミリ秒数です。
新しいタイムスタンプを表す整数で、協定世界時 (UTC) 1970 年 1 月 1 日 00:00:00 からのミリ秒数です。
その場で Date オブジェクトを変更し、新しいタイムスタンプを返します。 timeValue が NaN (または undefined など、 NaN に変換されるその他の値)の場合、日付は無効な日時に設定され、 NaN が返されます。
| ECMAScript® 2027 Language Specification # sec-date.prototype.settime |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年6月18日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.