3 Utilities for time manipulation.
6 ## convert(value, sourceUnit, [destinationUnit]):Number
8 Converts time between units.
10 Available units: `millisecond`, `second`, `minute`, `hour`, `day`, `week`.
11 Abbreviations: `ms`, `s`, `m`, `h`, `d`, `w`.
13 We do **not** support year and month as a time unit since their values are not
16 The default `destinationUnit` is `ms`.
19 convert(1, 'minute'); // 60000
20 convert(2.5, 's', 'ms'); // 2500
21 convert(2, 'm', 's'); // 120
22 convert(500, 'ms', 's'); // 0.5
29 Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
30 Uses `Date.now()` if available.
35 now(); // 1335449614650
42 Parse timestamp (milliseconds) into an object `{milliseconds:number,
43 seconds:number, minutes:number, hours:number, days:number}`.
48 // {days:27, hours:4, minutes:26, seconds:5, milliseconds:454}
54 ## toTimeString(ms):String
56 Convert timestamp (milliseconds) into a time string in the format "[H:]MM:SS".
61 toTimeString(12513); // "00:12"
62 toTimeString(951233); // "15:51"
63 toTimeString(8765235); // "2:26:05"