Encounter datetime should be after the visit start date

Apache Maven 3.6.0

Maven home: /usr/share/maven

Java version: 1.8.0_212, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre

Default locale: en_US, platform encoding: UTF-8

OS name: “linux”, version: “4.18.0-21-generic”, arch: “amd64”, family: “unix”

What is the time zone on your system?

UTC +6:30 Yangon/Myanmar

Can you reproduce it?

Not yet. Just for troubleshooting purposes, does it work if you temporarily change your time zone?

It work well with no problem at all after changing my timezone to UTC +01 London/UK.

Thanks for the feedback. Can you create a ticket for it?

Hi. I have read the entire forum on this problem that is also presented to me. I don’t know how to solve it.

“Encounter datetime should be after the visit start date”, when I try to enter the details of a visit to a patient who is already registered. I have tried several cases. The problem is that the openmrs date is one day ahead of my computer date.

My system is: centos 7, tomcat8. I installed Reference Application 2.10.0: I unzipped the ./OpenMRS folder without problems.

Please note on the screen: above in green openmrs indicates date June 9; bottom right the actual date is June 8.

[root@host ~]# timedatectl Local time: Tue 2020-06-09 09:18:15 -04 Universal time: Tue 2020-06-09 13:18:15 UTC RTC time: Tue 2020-06-09 00:44:39 Time zone: America/Caracas (-04, -0400) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: n/a [root@host ~]#

I would greatly appreciate your help.

Which version of Java are you running?

Hello everyone,

I know this is an old issue, but I just installed the downloadable version of OpenMRS 2.5 (for Enterprise, not standalone edition) from openmrs.org and encountered the same problem with dates and the message “The encounter date and time must be after the visit start date.”

The solution I found was to replace the Java library “Joda-Time.” In my OpenMRS installation, version 2.10.12 of this library was implemented, and I replaced it with version 2.12.7 in the Tomcat directory openmrs/WEB-INF/lib, and the problem was resolved.

My environment: Java openjdk 11.0.24, Tomcat 9.0.93, MySQL 8 community server

Best regards!