diff --git a/polyfill/lib/ecmascript.mjs b/polyfill/lib/ecmascript.mjs index 97836600f..c3bd59c8f 100644 --- a/polyfill/lib/ecmascript.mjs +++ b/polyfill/lib/ecmascript.mjs @@ -1494,9 +1494,20 @@ export function InterpretISODateTimeOffset( // "prefer" or "reject" const possibleEpochNs = GetPossibleEpochNanoseconds(timeZone, dt); if (possibleEpochNs.length > 0) { + const utcEpochNs = GetUTCEpochNanoseconds( + year, + month, + day, + time.hour, + time.minute, + time.second, + time.millisecond, + time.microsecond, + time.nanosecond + ); for (let index = 0; index < possibleEpochNs.length; index++) { const candidate = possibleEpochNs[index]; - const candidateOffset = GetOffsetNanosecondsFor(timeZone, candidate); + const candidateOffset = utcEpochNs - candidate; const roundedCandidateOffset = RoundNumberToIncrement(candidateOffset, 60e9, 'halfExpand'); if (candidateOffset === offsetNs || (matchMinute && roundedCandidateOffset === offsetNs)) { return candidate; diff --git a/spec/zoneddatetime.html b/spec/zoneddatetime.html index c401913d7..826e08a05 100644 --- a/spec/zoneddatetime.html +++ b/spec/zoneddatetime.html @@ -992,8 +992,9 @@