Skip to content

DBF header date set to 1 Jan 2049 when creating new files #24

@inkysquid

Description

@inkysquid

When the DbfHeader class is initialised, there is no way to set the _updateDate value, so it ends up as 1 Jan 2049 after the following:

  1. _updateDate defaults to DateTime.MinValue (1 Jan 0001)
  2. 1 - 1900 = -1899
  3. (byte)-1899 = 149
  4. When the file is read back: 149 + 1900 = 2049

Ideas

  • Consider defaulting _updateDate to the current time (using TimeProvider?)
  • Expose the _updateDate with a prop so it can be set explicitly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions