Skip to content

Bug: fn day_timestamp_micro produces wrong results #311

@marvinlanhenke

Description

@marvinlanhenke

Description:

fn day_timestamp_micro (source) seems to produce the wrong result which is off-by-one due to rounding errors.
Also the implementation does not align with the Java implementation, which handles the conversion slightly different.

An example of the wrong output can be seen in the test:
-115200000000 evaluates to 1969-12-30T16:00:00Z which should be days -2 (since epoch) and not -1.

Proposal:

Align Rust with Java implementation.
I already have a prototype, due to working on #264, so I will implement the fix in a different PR - so it can be verified more easily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions