> ## Documentation Index
> Fetch the complete documentation index at: https://bun.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://bun.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://bun.manicule.dev/api/mcp.
> Every agent surface: https://bun.manicule.dev/.well-known/llms-manifest.json

# Set a time zone in Bun (/guides/runtime/timezone)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 234 · updated: 2026-08-02 -->
Related: [Delete directories](/guides/runtime/delete-directory.md), [Delete files](/guides/runtime/delete-file.md), [Import a HTML file as text](/guides/runtime/import-html.md), [Import a JSON file](/guides/runtime/import-json.md), [Import a JSON5 file](/guides/runtime/import-json5.md), [Import a TOML file](/guides/runtime/import-toml.md)

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](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

<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`, the time zone is set to `UTC` to make tests more deterministic.
</Note>

```ts icon="/icons/typescript.svg" title="process.ts"
process.env.TZ = "America/New_York";
```

***

You can also set `TZ` on the command line when running a Bun command.

```sh icon="terminal" title="terminal" terminal
TZ=America/New_York bun run dev
```

***

Once `TZ` is set, every `Date` instance uses that time zone.

```ts icon="/icons/typescript.svg" title="process.ts"
new Date().getHours(); // => 18

process.env.TZ = "America/New_York";

new Date().getHours(); // => 21
```
