Skip to content

DateTime is nullable but you are not allowed to get null #134

@preuss

Description

@preuss

I am only able to get DateTime.MinValue if there is no DateTime on a File.
So even though this should be able to be null:
fileInfo.CreationTime
fileInfo.LastWriteTime
fileInfo.DateAuthored

I am only able to get DateTime.MinValue.
I can see that it´s the PropVariantFacade that needs to be corrected with some other classes.

It would be nice if this worked.

It also sets date to current date if there is a VT_ERROR: 0x80070490
public DateTime ToDate()
{
if (this.Value.vt == PropVariantType.VT_ERROR)
{
Debug.WriteLine($"VT_ERROR: 0x{this.Value.errorCode:X}");
return new DateTime();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions