@saadshahd/duration

1.0.1 • Public • Published

duration Build Status

Get milliseconds from duration

Install

$ npm install --save @saadshahd/duration

Usage

const duration = require('@saadshahd/duration');

duration('1s'); // 1000
duration('-1s'); // -1000
duration('1m'); // 60000
duration('1h'); // 3600000
duration('1d'); // 86400000
duration('1w'); // 604800000
duration('1M'); // 2592000000
duration('1Y'); // 31536000000
duration('1Y 1m 1h 1d 1s 1w 1M'); // 34822861000

Chars

Seconds: s, sec
Minutes: m, min
Hours  : h, hour
Days   : d, day
Weeks  : w, week
Months : M, month
Years  : Y, year

Related

  • seconds - Get milliseconds from seconds
  • minutes - Get milliseconds from minutes
  • hours - Get milliseconds from hours
  • days - Get milliseconds from days
  • weeks - Get milliseconds from weeks
  • months - Get milliseconds from months
  • years - Get milliseconds from years

License

MIT © Saad Shahd

Package Sidebar

Install

npm i @saadshahd/duration

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • saadshahd