Skip to content

Commit 50ab887

Browse files
authored
Merge pull request #116 from jumpserver/pr@dev@feat_timezone_z
fix: fix the time zone 'Z'
2 parents ca28a18 + 21f052a commit 50ab887

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backend/modules/src/main/java/org.jumpserver.chen.modules/mysql/MysqlConnectionManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ private void setTimeZone(Connection conn) throws SQLException {
5858
ZonedDateTime now = ZonedDateTime.now(zoneId);
5959
ZoneOffset offset = now.getOffset();
6060

61-
String offsetStr = offset.toString();
61+
String offsetStr = offset.equals(ZoneOffset.UTC) ? "+00:00" : offset.toString();
62+
6263

6364
try (Statement stmt = conn.createStatement()) {
6465
stmt.execute("SET time_zone = '" + offsetStr + "'");

0 commit comments

Comments
 (0)