Android with timezone h2 2038

I insert the date into the H2 database in the Android application, and when the date is more than January 19, 2038 (Unix error in 2038), the date that is stored in the database changes according to the time zone of the Android device.

Example: Date 2050-12-31

  • Time zone +2: 00 El Cairo saves 2050-12-29 (ERROR)
  • Time zone +2: 00 Amsterdam saves 2050-12-30 (ERROR)
  • Time zone +2: 00 Brussels saves 2050-12-31 (OK)
  • Japan Time Zone Saves 2050-12-31 (OK)
  • China time zone saves 2050-12-31 (OK)
  • Azores time zone saves 2050-12-31 (OK)

I believe that the Linux kernel using android has a 2038 error, but I don’t understand the reason that it works fine in some cases and not in others.

Any solution to this problem? Safely using jave.util.Date in Android?

+3
source share

All Articles