You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2020/10/15 18:40:02 UTC

[GitHub] [guacamole-client] necouchman commented on a change in pull request #460: GUACAMOLE-760: Add support for configuring server timezone.

necouchman commented on a change in pull request #460:
URL: https://github.com/apache/guacamole-client/pull/460#discussion_r505761204



##########
File path: extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLAuthenticationProviderModule.java
##########
@@ -82,6 +83,11 @@ public MySQLAuthenticationProviderModule(MySQLEnvironment environment)
         // Get the MySQL-compatible driver to use.
         mysqlDriver = environment.getMySQLDriver();
 
+        // If timezone is present, set it.
+        TimeZone serverTz = environment.getServerTimeZone();
+        if (serverTz != null)
+            driverProperties.setProperty("serverTimezone", serverTz.toString());

Review comment:
       I think `getID()` will be safer.  According to MySQL J/Connector documentation([1]):
   
   > The MySQL server is configured with a canonical time zone that is recognizable by Java (for example, Europe/Paris, Etc/GMT-5, UTC, etc.)
   
   This seems to match with Java's TimeZone documentation on ID([2]):
   
   > You can also get a TimeZone using getTimeZone along with a time zone ID. For instance, the time zone ID for the U.S. Pacific Time zone is "America/Los_Angeles".
   
   [1] - https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-other-changes.html
   [2] - https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org