skills/bun-guides-runtime-timezone/SKILL.md
Set a time zone in Bun
npx skillsauth add jarle/bun-skills Bun Set a time zone in BunInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Bun supports programmatically setting a default time zone for the lifetime of the bun process. To do set, set the value of the TZ environment variable to a valid timezone identifier.
When running tests with bun test, the timezone is set to UTC to make tests more deterministic.
</Note>
process.env.TZ = "America/New_York";
Alternatively, this can be set from the command line when running a Bun command.
TZ=America/New_York bun run dev
Once TZ is set, any Date instances will have that time zone. By default all dates use your system's configured time zone.
new Date().getHours(); // => 18
process.env.TZ = "America/New_York";
new Date().getHours(); // => 21
development
Using TypeScript with Bun, including type definitions and compiler options
development
Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers
testing
Learn how to use snapshot testing in Bun to save and compare output between test runs
testing
Learn about Bun test's runtime integration, environment variables, timeouts, and error handling