Skip to content

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

Notifications You must be signed in to change notification settings

acmoune/hhmmss2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published