Skip to content

How to go from count of milliseconds since epoch into a sys-time? #393

Description

@DavisVaughan

If you're given 1762527600000, which is "2025-11-07 10:00:00 EST" but in milliseconds, how to convert to a millisecond precision sys-time?

Can't go through duration_milliseconds() because it requires integers and that is >integer.max

Don't want to blindly allow doubles everywhere because they can be fractional, and because large double whole numbers are not precisely represented.

Maybe could add duration_parse(x, precision =) that takes a character x and parses it into an int64_t at C level and stores it at the requested precision. Then you can as_sys_time() that.

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