本页还没有译文
本页 6 段还没译成Español,下面显示的是英文原文。Set a time zone in Bun
还没翻译译自英文(bun.com)本页 6 段都还没译
Bun supports programmatically setting a default time zone for the lifetime of the bun process. Set the TZ environment variable to a valid time zone identifier.
Note
When running a file with bun, the time zone defaults to your system's configured local time zone.
When running tests with bun test, Bun sets the time zone to UTC to make tests more deterministic.
process.env.TZ = "America/New_York";You can also set TZ on the command line when running a Bun command.
TZ=America/New_York bun run devOnce TZ is set, every Date instance uses that time zone.
new Date().getHours(); // => 18
process.env.TZ = "America/New_York";
new Date().getHours(); // => 21AI 翻译查看英文原文