@datatypes/duration

0.4.0 • Public • Published

Duration

Full ISO 8601 compatible duration class.

Installation

npm install --save @datatypes/duration

Usage

const duration = new Duration('P1DT10H37M15.345S')

const anHour = new Duration()
	.setMinutes(60)
	.normalize()

Accuracy

The accuracy of a Duration object corresponds to the smallest defined quantity.

  • P1H means "around 1 hour" long
    • accuracy: hour
  • P1H0M0.0S means "exactly 60 * 60 * 1000 milliseconds" long
    • accuracy: millisecond

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.4.00latest

Version History

VersionDownloads (Last 7 Days)Published
0.4.00
0.3.00
0.2.00
0.1.00

Package Sidebar

Install

npm i @datatypes/duration

Weekly Downloads

0

Version

0.4.0

License

ISC

Last publish

Collaborators