A number of timezone related issues exist in the mifos-platform
1) Many SQL queries use now(), this would lead to potential errors when the timezone of the mysql database is different from the timezone of the tenant
A possible fix might be to set the timezone with the tenant specific mysql connection itself
2) Date formatters are used in multiple places, formatting a Timezone specific locale date with this date formatter (the timezone isn't set in the date formatter) would result in the dates being parsed based on the default format of the application server.
Ensure that all Date formatter (java.util and joda have timezone set)
code //java util final DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); df.setTimeZone(DateUtils.getTimeZoneOfTenant());
//joda final DateTimeFormatter fmt = DateTimeFormat.forPattern("dd MM yyyy"); fmt.withZone(DateUtils.getDateTimeZoneOfTenant()); code
3) Ensure that all times/ date times used in the code are set with the right Timezone
In general, while getting a date in the system, ensure that you get them from org.mifosplatform.infrastructure.core.service.DateUtils.java class (returns the date/ local date based on the timezone of the tenant)
|