mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +02:00
Timezone improvements
This commit is contained in:
parent
35303147e4
commit
4a8b3b9973
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue