- MomentJS 教程
- MomentJS - 主頁
- MomentJS - 概覽
- MomentJS - 環境設定
- MomentJS - 簡介
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - Getter/Setter
- 操作日期和時間
- 格式化日期和時間
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - 持續時間
- MomentJS - 實用程式
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 有用資源
- MomentJS - 快速指南
- MomentJS - 有用資源
- MomentJS - 討論
MomentJS - 秒
此方法將給出持續時間中的秒數。返回的值介於 0-59 之間。如果您想要持續時間內的秒數的適當長度,請使用 **moment.duration().asSeconds().**
語法
moment.duration().seconds(); moment.duration().asSeconds();
示例
var a = moment.duration(20000).seconds();
輸出
如果您想要顯示持續時間內的秒數的長度,請使用 moment.duration().asSeconds() 如下 -
示例
var a = moment.duration(600).asSeconds();
輸出
momentjs_durations.htm
廣告