@@ -1480,7 +1480,7 @@ export function InterpretISODateTimeOffset(
1480
1480
export function ToTemporalZonedDateTime ( item , options = undefined ) {
1481
1481
let isoDate , time , timeZone , offset , calendar ;
1482
1482
let matchMinute = false ;
1483
- let offsetBehaviour = 'option' ;
1483
+ let hasUTCDesignator = false ;
1484
1484
let disambiguation , offsetOpt ;
1485
1485
if ( Type ( item ) === 'Object' ) {
1486
1486
if ( IsTemporalZonedDateTime ( item ) ) {
@@ -1503,9 +1503,6 @@ export function ToTemporalZonedDateTime(item, options = undefined) {
1503
1503
[ 'timeZone' ]
1504
1504
) ;
1505
1505
( { offset, timeZone } = fields ) ;
1506
- if ( offset === undefined ) {
1507
- offsetBehaviour = 'wall' ;
1508
- }
1509
1506
const resolvedOptions = GetOptionsObject ( options ) ;
1510
1507
disambiguation = GetTemporalDisambiguationOption ( resolvedOptions ) ;
1511
1508
offsetOpt = GetTemporalOffsetOption ( resolvedOptions , 'reject' ) ;
@@ -1517,11 +1514,7 @@ export function ToTemporalZonedDateTime(item, options = undefined) {
1517
1514
RequireString ( item )
1518
1515
) ) ;
1519
1516
timeZone = ToTemporalTimeZoneIdentifier ( tzAnnotation ) ;
1520
- if ( z ) {
1521
- offsetBehaviour = 'exact' ;
1522
- } else if ( ! offset ) {
1523
- offsetBehaviour = 'wall' ;
1524
- }
1517
+ if ( z ) hasUTCDesignator = true ;
1525
1518
if ( ! calendar ) calendar = 'iso8601' ;
1526
1519
calendar = CanonicalizeCalendar ( calendar ) ;
1527
1520
// Allow imprecise offset matching unless the provided offset is precise
@@ -1538,6 +1531,12 @@ export function ToTemporalZonedDateTime(item, options = undefined) {
1538
1531
GetTemporalOverflowOption ( resolvedOptions ) ; // validate and ignore
1539
1532
isoDate = { year, month, day } ;
1540
1533
}
1534
+ let offsetBehaviour = 'option' ;
1535
+ if ( hasUTCDesignator ) {
1536
+ offsetBehaviour = 'exact' ;
1537
+ } else if ( ! offset ) {
1538
+ offsetBehaviour = 'wall' ;
1539
+ }
1541
1540
let offsetNs = 0 ;
1542
1541
if ( offsetBehaviour === 'option' ) offsetNs = ParseDateTimeUTCOffset ( offset ) ;
1543
1542
const epochNanoseconds = InterpretISODateTimeOffset (
0 commit comments