- MomentJS 教程
- MomentJS - 首頁
- MomentJS - 概覽
- MomentJS - 環境設定
- MomentJS - 簡介
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - Getter/Setter
- 操作日期和時間
- 日期和時間格式化
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - Duration
- MomentJS - 工具函式
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 有用資源
- MomentJS - 快速指南
- MomentJS - 有用資源
- MomentJS - 討論
MomentJS - 時間減法
此方法將從給定的 Duration 中減去時間。
語法
moment.duration().subtract(Number, String); moment.duration().subtract(Number); moment.duration().subtract(Duration); moment.duration().subtract(Object);
示例
var d = moment.duration(500, 'days');
var st = moment.duration(500, 'days').subtract({ days: 7, months: 1 });
輸出
momentjs_durations.htm
廣告