- 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
广告