Files
scriptc/packages/runtime
Chris Tate d33b083a3b Cache the zone offset at UTC midnights for local-time conversions
Local setters and the field constructor convert a local time value to
UTC by bracketing it with the zone offset a day before and after, then
checking the candidate instants: three to five localtime(3) calls per
conversion. In glibc each call takes the zone lock and, for dates past
the zone file's last transition, parses the zone's rule string again.

The offsets now come from a per-thread cache of offsets at UTC midnights:
a day whose two midnights agree has that offset throughout, given at
most one transition per day, which the conversion already assumes. A
day with a transition still asks localtime for the instant. A change of
process.env.TZ clears the cache.
2026-10-25 17:30:44 -05:00
..
2026-07-22 18:08:04 -05:00
2026-10-25 11:26:13 -05:00