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月.
Date 實例的 getUTCHours() 方法會根據世界協調時間回傳此日期的的小時數。
無。
一個介於 0 到 23 之間的整數,表示給定日期根據世界標準時間的小時。如果日期為無效的,則回傳 NaN。
以下範例將目前時間的小時部分指派給 hours 變數。
| ECMAScript® 2027 Language Specification # sec-date.prototype.getutchours |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年8月7日 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.