1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 02:09:22 +02:00

Timezone improvements

This commit is contained in:
DanieL 2022-04-20 14:50:44 -03:00
parent 35303147e4
commit 4a8b3b9973

View file

@ -1977,6 +1977,17 @@ function clearServerTime() {
_serverDBTimezone = null;
}
function convertDBDateToLocal(dbDateString){
if(!/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/.test(dbDateString)){
return dbDateString;
}
if(!_serverDBTimezone){
getServerTime();
}
var date = new Date(dbDateString+' '+_serverDBTimezone);
return date.toJSON().slice(0, 19).replace('T', ' ');
}
function addGetParam(_url, _key, _value) {
if (typeof _url !== 'string') {
return false;