Skip to content

Add epoch_ns_for for PlainDate/Time/DateTime#699

Closed
Manishearth wants to merge 2 commits intoboa-dev:mainfrom
Manishearth:epochnsfor
Closed

Add epoch_ns_for for PlainDate/Time/DateTime#699
Manishearth wants to merge 2 commits intoboa-dev:mainfrom
Manishearth:epochnsfor

Conversation

@Manishearth
Copy link
Contributor

Turns out we need them, just converting to ZDT isn't enough since ZDT can be out-of-range

https://g-issues.chromium.org/489023921

@Manishearth Manishearth requested a review from nekevss March 19, 2026 17:37
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I just have a small doc fix

)
}

/// Gets the epochMilliseconds represented by this PlainDate in the given timezone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Gets the epochMilliseconds represented by this PlainDate in the given timezone
/// Gets the EpochNanoseconds represented by this PlainDate in the given timezone

Also applies to the rest of the new methods

@Manishearth
Copy link
Contributor Author

Actaully, it turns out this doesn't fix the issue since we still range-check here. PLUS the API shape changed here; since it doesn't need the time zone anymore (see tc39/proposal-temporal#3212)

I'll redo this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants