Skip to content

Increased fractional precision in Duration strings #26

@ptomato

Description

@ptomato

(Moved from tc39/proposal-temporal#1712)

Temporal.Duration strings are currently allowed to specify fractional hours, minutes, and seconds, up to 9 digits.

Advantages:

Example strings that are currently rejected by Temporal.Duration.from(), that nonetheless represent exact numbers of nanoseconds:

  • PT0.00000000001H → 36 nanoseconds
  • PT0.0000000001M → 6 nanoseconds

Concerns:

Increasing the allowed precision beyond 9 digits for fractional seconds, 10 digits for fractional minutes, or 11 digits for fractional hours, may pose implementation difficulties since implementations would have to calculate with fractional nanoseconds.

Prior art:

  • TBD

Constraints / corner cases:

  • TBD

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