Skip to content

Add feature flag for accessing host's system timezone#4625

Open
Vellumic wants to merge 1 commit intoboa-dev:mainfrom
Vellumic:feat/system-time-zone
Open

Add feature flag for accessing host's system timezone#4625
Vellumic wants to merge 1 commit intoboa-dev:mainfrom
Vellumic:feat/system-time-zone

Conversation

@Vellumic
Copy link

@Vellumic Vellumic commented Feb 12, 2026

Changes:

  • Cargo.toml: Moved iana-time-zone to added system-time-zone flag dependencies
  • core/engine/src/builtins/temporal/now.rs:
    • Wrapped temporal_rs::TemporalError import with #[cfg(feature = "system-time-zone")]
    • get_host_time_zone() now uses iana-time-zone::get_timezone() only when flag is enabled, TimeZone::utc_with_provider() otherwise

Verification:

  • Automated tests: Ran
    • cargo test --package boa_engine --all-targets --features system-time-zone (all passed)
    • cargo test --package boa_engine --all-targets --no-default-features (all passed)
  • Manual check: With flag
$ cargo run --features system-time-zone
>> Temporal.Now.timeZoneId()
"Australia/Sydney"

Without flag

$ cargo run
>> Temporal.Now.timeZoneId()
"UTC"

This Pull Request closes #4599

@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,862 52,862 0
Passed 49,471 49,471 0
Ignored 2,249 2,249 0
Failed 1,142 1,142 0
Panics 0 0 0
Conformance 93.59% 93.59% 0.00%

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.

Feature flag system-time-zone access

1 participant