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
- Host: GitHub
- URL: https://github.com/zhw2590582/duration-time-conversion
- Owner: zhw2590582
- License: mit
- Created: 2019-09-30T08:35:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-13T01:36:00.000Z (almost 2 years ago)
- Last Synced: 2024-11-11T20:30:02.946Z (over 1 year ago)
- Topics: conversion, duration, time
- Language: JavaScript
- Size: 10.7 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/)