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

輸出

Second
momentjs_getter_setter.htm
廣告
© . All rights reserved.