Java date issue with Daylight saving

One of our UK clients complained that some of the timestamp settings in IFS are incorrect. This issue was noticed in Tasks where the received timestamp is one hour behind of the actual time. 2017-04-21 07_10_11-IFSDEV1_IFSDEV2 Application Server (10.44.10.77) - Remote Desktop Connection Man

After some debugging the function call to save the task, we identified that the received time is set from the application server and seems this is an issue with Java Date class.

It could be verified that Java is picking the wrong date by writing a small program which gets the java date, exactly the same way the IFS middletier code sets the value for Received field.

import java.util.Date.*;

public class date {
    public static void main(String[] args) {
		System.out.println(new java.util.Date().toString());
    }
}

Making this issue more complicated, we’ve found that this issue only exist for the Java version packed with IFS App8 (Java version 1.7.0_45) but not exist in java 1.8

2017-04-21 07_41_26-E__test_apps_date_date.java - Notepad++
Daylight Saving not considered in java 1.7 (IFS bundled java version for App8)
2017-04-21 07_42_00-E__test_apps_date_date.java - Notepad++
Correct time with daylight saving  in java 1.8

We could not find any information in java release notes regarding this sort of an issue but  Java 8 troubleshooting guide  shed light on this issue as it seems Java timezone depends on the Time Zone information registry value.

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation]

In the customer registry settings, DynamicDaylightTimeDisabled registry value which java looks for is correctly defined but seems DisableAutoDaylightTimeSet value causing  the issue.

Resolution

Setting the DisableAutoDaylightTimeSet=0 seems to solve the issue.

  1. Launch the Registry Editor (regedit.exe).
  2. Navigate to HKLMSYSTEMCurrentControlSetControlTimeZoneInformation
  3. Double-click on DisableAutoDaylightTimeSet, change the value to 0 and click on OK button.

2 Comments

    1. Thanks Buddie for following my blog.

      This issue should exist for all places where the date is fetched from the application server logic. All the dates in application forms are fetched from database so they won’t affect. But I guess date values in application messages, application server log files should have the incorrect date.

      Cheers!

Leave a Reply to dsj23 Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s