Skip to content

Commit 9cabd17

Browse files
committed
FINERACT-1696: Update README with instructions concerning Mysql UTC behavior
1 parent 7fe34c3 commit 9cabd17

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,31 @@ Beware that this database container database keeps its state inside the containe
3535

3636
Tomcat v9 is only required if you wish to deploy the Fineract WAR to a separate external servlet container. Note that you do not require to install Tomcat to develop Fineract, or to run it in production if you use the self-contained JAR, which transparently embeds a servlet container using Spring Boot. (Until FINERACT-730, Tomcat 7/8 were also supported, but now Tomcat 9 is required.)
3737

38+
IMPORTANT: if you use MySQL or MariaDB
39+
============
40+
41+
Recently (after release 1.7.0) we introduced improved date time handling in Fineract. Date time is from now on stored in UTC and we are enforcing UTC timezone even on the JDBC driver, e. g. for MySQL:
42+
43+
```
44+
serverTimezone=UTC&useLegacyDatetimeCode=false&sessionVariables=time_zone=‘-00:00’
45+
```
46+
47+
__DO__: If you do use MySQL as your Fineract databsae then the following configuration is highly recommended:
48+
49+
* Run the application in UTC (the default command line in our Docker image has the necessary parameters already set)
50+
* Run the MySQL database server in UTC (if you use managed services like AWS RDS then this should be the default anyway, but it would be good to double-check)
51+
52+
__DON'T__: In case the Fineract instance and the MySQL server are __not__ running in UTC then the following could happen:
53+
54+
* MySQL is saving date time values differently from PostgreSQL
55+
* Example scenario: if the Fineract instance runs in timezone: GMT+2, and the local date time is 2022-08-11 17:15 ...
56+
* ... then __PostgreSQL saves__ the LocalDateTime as is: __2022-08-11 17:15__
57+
* ... and __MySQL saves__ the LocalDateTime in UTC: __2022-08-11 15:15__
58+
* ... but when we __read__ the date time from PostgreSQL __or__ from MySQL, then both systems give us the same values: __2022-08-11 17:15 GMT+2__
59+
60+
If a previously used Fineract instance didn't run in UTC (backward compatibility), then all prior dates will be read wrongly by MySQL/MariaDB. This can cause issues when you run the database migration scripts.
61+
62+
__RECOMMENDATION__: you need to shift all dates in your database by the timezone offset that your Fineract instance used.
3863

3964
Instructions how to run for local development
4065
============

0 commit comments

Comments
 (0)