- MomentJS 教程
- MomentJS - 主頁
- MomentJS - 概述
- MomentJS - 環境設定
- MomentJS - 簡介
- MomentJS - 解析日期和時間
- MomentJS - 日期驗證
- MomentJS - 獲取/設定器
- 操作日期和時間
- 設定日期和時間的格式
- MomentJS - 日期查詢
- MomentJS - 國際化
- MomentJS - 自定義
- MomentJS - 持續時間
- MomentJS - 效用函式
- MomentJS - 外掛
- MomentJS - 示例
- MomentJS 有用資源
- MomentJS - 快速指南
- MomentJS - 有用資源
- MomentJS - 討論
MomentJS - 秒
此方法將獲取/設定秒數。它接受 0-59 的輸入;如果大於提供的範圍,則會新增到分鐘中。
語法
moment().second(Number); moment().second(); moment().seconds(Number); moment().seconds();
示例
var m = moment().second(); //gives current second var d = moment().second(10); //sets the second to 10 as shown below
輸出
momentjs_getter_setter.htm
廣告