- MomentJS 教程
- MomentJS - 主頁
- MomentJS - 概述
- MomentJS - 環境設定
- MomentJS - 介紹
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - 設值取值函式
- 處理日期和時間
- 格式化日期和時間
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - 時間段
- MomentJS - 實用工具
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 有用資源
- MomentJS - 快速指南
- MomentJS - 有用資源
- MomentJS - 討論
MomentJS - 小時
此方法將顯示持續時間的小時數。返回值介於 0-23 之間。如果你需要該持續時間的正確時數,請使用 moment.duration().asHours();
語法
moment.duration().hours(); moment.duration().asHours();
示例
var h = moment.duration(500, "hours").hours(); var ashrs = moment.duration(500, "hours").asHours();
輸出
momentjs_durations.htm
廣告