create moment duration

moment.duration(2, 'seconds');
moment.duration(2, 'minutes');
moment.duration(2, 'hours');
moment.duration(2, 'days');
moment.duration(2, 'weeks');
moment.duration(2, 'months');
moment.duration(2, 'years');
moment.duration('2', 'years'); // from 2.25.0

// or create from an object
moment.duration({
    seconds: 2,
    minutes: 2,
    hours: 2,
    days: 2,
    weeks: 2,
    months: '2',
    years: '2'
});

// or create from an iso 8601 string
moment.duration('P1Y2M3DT4H5M6S');
moment.duration('P1M');

// duration format strings with a space between days and rest is also supported.
moment.duration('7 23:59:59.999');

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to use moment.duration how to format duration in moment crate moment with specific time moment format duration js formatting duration in moment moment duration format time using durations in moment js create moment time moment.duration example moment js duration formatting javascript add moment duration to moment duration javascript add moment duration format duration moment js moment js format duration duration moment js format import moment duration format in duration moment moment.duration format moment generating function normal 4th moment moment format duration create moment from duration moment.js duration formatting standard duration format moment.js how to format moment duration create moment from a time javascript moment add duration moments duration https://momentjs.com duration moment().duration nodejs moment duration moment parse duration from milliseconds moment .duration moment js how to add duration to current date momentjs unix epoch moment js miliseconds how insert day in moment js list each clock hour between start and end of day moments moment format duration to days moment format duration days duration moment moment.duration() in javascript moment.duration() get moment js in seconds momentjs format duration moment.duration moment.duration(duration); momnnet duration second momnnet duration moment duration moment().startOf('year').seconds(date).format('DDD [days,] HH [hrs,] mm [mins,] ss [secs]') sets days to 1 every time moment().startOf('year').seconds(data).format('DDD [days,] HH [hrs,] mm [mins,] ss [secs]') sets days to 1 every time intervalToDuration format hh:mm moment duration format moment force format fromnow moment js print minutes moment.utc(moment.duration moment set hours moment js duration format js duration moment.js duration moment js milliseconds now with hours minutes seconds momentjs duration momentjs duration minutes moment js hours to minutes duration i moment js moment typescript moment js duration milliseconds node js moment add seconds js moment duration moment js duration momentjs number of milliseconds to length create moment duration
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source