mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 10:49:36 +02:00
Updates
This commit is contained in:
parent
8c27070d24
commit
3b74f82d4b
5 changed files with 46 additions and 18 deletions
|
@ -4035,4 +4035,21 @@ function randomColor() {
|
|||
var g = Math.floor(Math.random() * 255);
|
||||
var b = Math.floor(Math.random() * 255);
|
||||
return r + "," + g + "," + b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function secondsToTime(sec) {
|
||||
var rest = parseInt((sec % 1) * 100);
|
||||
var date = new Date(null);
|
||||
date.setSeconds(sec); // specify value for SECONDS here
|
||||
var timeString = date.toISOString().substr(11, 8);
|
||||
return (timeString + '.' + rest);
|
||||
}
|
||||
|
||||
|
||||
function timeToSeconds(hms) {
|
||||
var a = hms.split(':'); // split it at the colons
|
||||
// minutes are worth 60 seconds. Hours are worth 60 minutes.
|
||||
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
|
||||
return (seconds);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue