Skip to content

Unsafe instantiation of DateTime #2

@GrabYourPitchforks

Description

@GrabYourPitchforks

It is not safe to reinterpret_cast<> an arbitrary 64-bit value to a DateTime instance. Among other things, the .NET Framework and .NET Core runtimes do not guarantee that DateTime structure is backed by a single 64-bit integer field, and the DateTime type does not guarantee that all possible 64-bit representations are valid.

See offline comment for more details on how to do this safely and reliably.

Ref:

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