How to change DBeaver timezone / How to stop DBeaver from converting date and time

前端 未结 6 1331
终归单人心
终归单人心 2020-12-14 07:34

When I use DBeaver with Cassandra, it shows an offset of +01:00 even though the data is stored in Date or Times formats, that don\'t have any timezones. This results in some

相关标签:
6条回答
  • 2020-12-14 08:19

    I think it was fixed in some previous release.

    Just go to Settings -> Editors -> Data Formats and select 'Use native date/time format' checkbox.

    enter image description here

    0 讨论(0)
  • 2020-12-14 08:31

    If you wanna see the TimeZone of your Selects, you can go to DBeaver Preferences:

    Preferences

    1. Click on Type, and change it to Timestamp
    2. In Pattern Value add the termination " Z z" and see the Sample result like this: 2019-11-06 07:38:54 -0300 BRT
    3. Tap Apply, and Apply and Close
    4. Done :)
    0 讨论(0)
  • 2020-12-14 08:32

    On Mac

    1. Go to Finder > Applications
    2. Right click on DBeaver and select Show Package Contents
    3. Open Contents\Eclipse\dbeaver.ini
    4. After the -vmargs line, add this: -Duser.timezone=UTC
    5. Save file and restart DBeaver

    Limitation: You’ll have to redo this for every version upgrade.

    Windows

    1. Go to DBeaver install directory C:\Program Files\DBeaver
    2. Open dbeaver.ini
    3. After the -vmargs line, add this: -Duser.timezone=UTC
    4. Save file and restart DBeaver

    Source: This blog

    0 讨论(0)
  • 2020-12-14 08:34

    If this is the JDBC driver issue with regards to the timezone:
    Right click on the connection to open connection settings

    change the timezone

    OR you may also change the server timezone driver property

    0 讨论(0)
  • 2020-12-14 08:36

    I found another solution:

    Setting dbeaver.ini file in DBeaver root directory.

    Open the file:

    -startup
    plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
    -showsplash
    # START: change jre version, not using the one in %JAVA_HOME%
    -vm 
    D:\ArPortable\Java\jdk1.8.0_171\jre\bin\server\jvm.dll
    # END
    # JVM settings
    -vmargs
    -XX:+IgnoreUnrecognizedVMOptions
    --add-modules=ALL-SYSTEM
    -Xms64m
    -Xmx1024m
    # time zone
    -Duser.timezone=UTC
    # language
    -Duser.language=en
    
    0 讨论(0)
  • 2020-12-14 08:40

    DBeaver uses the time in the computer that is installed, so changing the clock and restarting DBeaver works. But there is a way to do it only for DBeaver instead.

    • Close DBeaver.
    • Go to the DBeaver shortcut. Probably it is here:

      C:\ProgramData\Microsoft\Windows\Start Menu\Programs\DBeaver

    • Right-click on it, choose Properties and in the Target box add -vmargs -Duser.timezone=UTC to the end, resulting in something like this:

      "C:\Program Files\DBeaver\dbeaver.exe" -vmargs -Duser.timezone=UTC

    • Start DBeaver and the times now appear in UTC.

    0 讨论(0)
提交回复
热议问题