Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default custom DateTime value bug #228

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

gyk4j
Copy link
Owner

@gyk4j gyk4j commented Mar 12, 2024

Java new Date() defaults to current time of object instantiation, which would not trip the special cases by default.
C#.NET new DateTime() defaults to a hard coded 01-01-0001 00:00:00.000 which causes the extracted metadata value to be overwritten.

This causes confusion in the date time value selection in TimestampReducer that picks the wrong default file system value because the supposed user-defined custom date time is earlier than even the application-defined lower limit of 01-01-1980.

This is further overwritten by a placeholder value introduced during development which defaults to the current file system file time (creation, last modified, last accessed).

In summary, the bug was a series of wrong values replacing each other:

  1. Accurate extracted value replaced by the wrong date time default value of 01-01-0001
  2. 01-01-0001 as a user-defined time is replaced by the application TimeUtils.VALID_PERIOD_MIN limit of 01-01-1980 allowed by Windows Explorer
  3. The 01-01-1980 value limit is replaced by a placeholder value filled with the current file system time.

The placeholder value was introduced to allow the application to run but was forgotten.

@gyk4j gyk4j merged commit c11c0fa into main Mar 12, 2024
1 check passed
@gyk4j gyk4j deleted the 20240312-fix-default-custom-datetime-value branch March 12, 2024 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant