timestamps
timestamps is a small Node.js module for parsing and formatting video and ASS subtitle timestamps.
Installation
timestamps is available via npm:
$ npm install timestamps
Usage
var time = ; // time.parse(string) will parse valid full and ASS timestamps into millisecondsvar test1 = time; // -> 5062203var test2 = time; // -> 3825210 // time.stamp(ms) and time.ass(ms) will return valid full and ASS timestamps from millisecondstime; time; // -> "01:24:22.203", "01:03.45.210"time; time; // -> "1:24:22.20", "1:03:45.21" // time.parts(ms) returns an object with the individual parts of the timestamps.// You can be use it eg. for creating custom timestamps with your own formatting.// If you need simple zero padding, get the 'zpad' module from npm.time; // -> {hh: 1, mm: 24, ss: 22, cs: 20, ms: 203}time; // -> {hh: 1, mm: 3, ss: 45, cs: 21, ms: 210}