An open API service indexing awesome lists of open source software.

https://github.com/zhw2590582/duration-time-conversion

Duration and time format conversion
https://github.com/zhw2590582/duration-time-conversion

conversion duration time

Last synced: 11 months ago
JSON representation

Duration and time format conversion

Awesome Lists containing this project

README

          

# duration-time-conversion

> Duration and time format conversion

## Install

Install with `npm`

```bash
$ npm install duration-time-conversion
```

Or install with `yarn`

```bash
$ yarn add duration-time-conversion
```

```js
import DT from "duration-time-conversion.js";
```

Or umd builds are also available

```html

```

Will expose the global variable to `window.DT`.

## Usage

```js
// Duration to time
DT.d2t(3661.111) === "01:01:01.111";

// Time to Duration
DT.t2d("01:01:01.111") === 3661.111;
```

## License

MIT © [Harvey Zack](https://sleepy.im/)