Moment.jsオンラインランナー
Moment.js ドキュメント
Day.js ドキュメント
移行のヒント
日本語
moment()
現在時刻を取得
moment().format()
日時をフォーマット
moment().add()
時間を追加
moment().diff()
時間差を計算
moment().isAfter()
2つの日付の順序を確認
moment().isBefore()
日付の順序を比較
moment().isSame()
同じ日付を確認
moment().clone()
momentオブジェクトをコピー
moment().toISOString()
ISO文字列に変換
moment().hours()
時間を取得または設定
moment().isValid()
日付の有効性を確認
moment().startOf()
時間の開始を設定
moment().endOf()
時間の終了を設定
moment().utc()
UTCに変換
moment().local()
ローカルタイムゾーンに変換
moment().format()
moment().add()
moment().diff()
moment().isAfter()
console.log(moment().format('MMMM Do YYYY, h:mm:ss a')); console.log(moment().format('dddd')); console.log(moment().format("MMM Do YY")); console.log(moment().format()); console.log(dayjs().format('MMMM Do YYYY, h:mm:ss a'));
output:
[Vercel Web Analytics] Failed to load script from /_vercel/insights/script.js. Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.
コードを実行
リセット