Skip to content

DateTime cell does not get converted to a DateOnly value #869

@RiRiSharp

Description

@RiRiSharp

Excel Type

  • XLSX
  • XLSM
  • CSV
  • OTHER

Upload Excel File

DateTimeMidnight.xlsx
DateTimeNotMidnight.xlsx

MiniExcel Version

v2.0.0-preview

Description

Create an Excel file as enclosed.
Create a matching class:

private class DateTimeSheet
{
    public string? Name { get; set; }
    public DateOnly? Date { get; set; }
}

Run var items = _excelImporter.Query<DateTimeSheet>(path) and you will get a MiniExcelInvalidCastException.

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