Project

General

Profile

Bug #10181

Date shifted one day earlier when importing data

Added by Lorian Sandu about 1 year ago. Updated about 1 year ago.

Status:
Test
Priority:
Normal
Assignee:
Lorian Sandu
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
production:
No
env_name:
topics:

Related issues

Related to Database - Feature #7504: Export data tool from FWD into .d files Test

History

#1 Updated by Lorian Sandu about 1 year ago

  • % Done changed from 0 to 100

In #7504-31 :

I also encountered a potential bug during import:
  • I imported a .d file containing the value 01/01/1920 for a date column.
  • After import, the stored value in the database was 1919-12-31 (disregarding the formatting), which indicates the date was altered during the import process.

I've created 10181a and and committed the fix to rev / 15992.

It'a small fix in DateType.setField :
  • instead of using the default jvm timezone that would alter the date, use UTC timezone.

Ovidiu, when you are available please take a look on the branch.

#2 Updated by Lorian Sandu about 1 year ago

  • Status changed from New to WIP

#3 Updated by Lorian Sandu about 1 year ago

  • Status changed from WIP to Review

#4 Updated by Lorian Sandu about 1 year ago

  • reviewer Ovidiu Maxiniuc added

#5 Updated by Lorian Sandu about 1 year ago

  • Related to Feature #7504: Export data tool from FWD into .d files added

#6 Updated by Ovidiu Maxiniuc about 1 year ago

  • Status changed from Review to Internal Test

I am OK with the change because the UTC will leave the data unaffected by the TZ.

However, I think all occurrences of date.dateValue(TimeZone) might require rethinking and in relation, date.dateValue() as well. That is because the reverse operation (_getDate()) will return date instances created with TimeZone.getDefault() timzone (which is the default is null is used). So they are no longer pairing.

As a side-note, I still have a strong opinion that the date implementation is too complex. It should be timezone agnostic. In fact, the only data type which is supposed to be TZ aware is datetime-tz. We are not sure how this is store in OE, but the educated guess (based on OE direct compatibility with int, date aritmetic) is its representation as as simple as an int meaning then number of days passed since the epoch. Actually, we do something like this, but most operations involve a GregorianCalendar instance and TZ. I think there is a task for reimplement the date related types using the new (not so new any more) time API (LocalDate).

#7 Updated by Lorian Sandu about 1 year ago

  • Assignee set to Lorian Sandu

Thanks, Ovidiu.

What testing should be performed for this change?

#8 Updated by Lorian Sandu about 1 year ago

Update on the regression testing:

  • harness ✅
  • large app with fwd tests -- unittests ✅
  • large GUI app unittests ✅
  • chui regression tests ✅

The change is relatively safe and straightforward. Branch 10181a is ready to be merged.

#9 Updated by Ovidiu Maxiniuc about 1 year ago

  • Status changed from Internal Test to Test

Branch 10181a was merged into trunk on behalf of Lorian (ls) as rev. 16010 and archived.

Also available in: Atom PDF