1.0.1 • Published 7 years ago

hhmmss2 v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

hhmmss2

Take number of seconds, or a youtube formatted duration and return duration in format 00:00:00

Usage

const hhmmss = require('hhmmss2');
hhmmss((3 * 60) + 15); // return 03:15
hhmmss((3 * 60 * 60) + (2 * 60) + 15); // return 3:02:15

// Also convert youtube formatted duration
hhmmss.yt('PT12M17S'); // return 12:17

// You can change the default separator
hhmmss((3 * 60) + 15, '-'); // return 03-15
hhmmss.yt('PT12M17S', ''); // return 1217