Momentjs-seconds

提供:Dev Guides
移動先:案内検索

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();

出力