Applies to:
- Liquibase Pro
- Liquibase Open Source (Community)
Conditions:
- Any version of Liquibase
Question:
How do you set the time zone Liquibase uses?
Answer:
Liquibase uses the time on the host/agent's machine (which is inside the JVM). Some databases provide a JDBC connection parameter to set the timezone for the connection. For example, the MySQL JDBC driver has connectionTimeZone. However, PostgreSQL does not have an option for time zone.
However, the JAVA_OPTS Environment Variables can be utilized to set the Java Virtual Memory timezone that Liquibase uses.
Linux/Mac
JAVA_OPTS="-Duser.timezone=GMT" liquibase update
Windows
set JAVA_OPTS=-Duser.timezone=GMT && liquibase update
The above examples will deploy all eligible changesets, and the date executed will be in GMT.
Related Articles:
JAVA_OPTS Environment Variable
MySQL JDBC Configuration Properties
PostgreSQL JDBC Connection Parameters
Comments
0 comments
Article is closed for comments.