Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session timezone in PHPMyAdmin

Is there anyway I can change the session timezone of PHPMyAdmin?

I'm using a foreign MySQL server that I could not change timezone of. I want to see timestamps at my timezone in all my PHPMyAdmin sessions. Is there any "session script" I can set so they runs on every PHPMyAdmin session? Or is there any other way to do so?

like image 996
Koala Yeung Avatar asked Dec 03 '25 21:12

Koala Yeung


1 Answers

Patched libraries/dbi/DBIMysqli.class.php as a workaround.
Telling mysqli to use phps default timezone, could be replaced with a string.

--- a/libraries/dbi/DBIMysqli.class.php    2016-03-11 09:09:27.538801633 +0100
+++ b/libraries/dbi/DBIMysqli.class.php 2016-03-11 09:12:15.099759342 +0100
@@ -223,6 +223,8 @@ class PMA_DBI_Mysqli implements PMA_DBI_
             return false;
         }

+       $link->query("SET time_zone = '" . date("P"). "'");
+
         return $link;
     }
like image 136
Puggan Se Avatar answered Dec 06 '25 10:12

Puggan Se



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!