dart-sdk/sdk
Lasse R.H. Nielsen 6af4987dc6 Change VM DateTime to-local-time computation to not fail for <1h changes.
The DateTime conversion to local time amounts to solving an
equation, finding an offset where the current local time is that offset.

The current approach doesn't actually do that, it just tries to simulate
the JS approach, with a tweak to avoid DST change issues, but that tweak
assumes that all time zone adjustments are one hour changes.

This CL should work correctly for time zone changes of up to one hour,
but might still fail for changes of more than one hour.
It works by trying more offsets, which obviously has a performance cost,
which depends on how efficient the operation system is at providing
the local time zone for a specific milliseconds-since-epoch.

Change-Id: I80dc6e62e0639d9966d3c5a06430787d8acc4ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182041
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-04-08 16:51:00 +00:00
..
bin Remove (most) uses of the "non-nullable" experiment flag. 2021-02-12 17:16:54 +00:00
lib Change VM DateTime to-local-time computation to not fail for <1h changes. 2021-04-08 16:51:00 +00:00
api_readme.md Update the API docs readme 2020-01-16 21:23:09 +00:00
BUILD.gn [wasm] Remove deprecated dart_enable_wasm flag. 2021-04-01 22:45:07 +00:00