> ## Documentation Index
> Fetch the complete documentation index at: https://developer.upsun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Timezones

> Learn more about the different timezones on Upsun and when you can customize them.

export const VariableBlock = ({name}) => {
  return <var spellCheck={false} title={`Replace '${name}' with your own data`}>{name}</var>;
};

On Upsun, there are several timezones you might want to keep in mind.
All timezones default to UTC time.
You can customize some of them, but in most cases,
it's best if you leave them in UTC
and store user data with an associated timezone instead.

The different timezones on Upsun are the following:

| Timezone             | Description                                                                                                                                                                                                                                                                         | Customizable |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| Container timezone   | The timezone for all Upsun containers (UTC).                                                                                                                                                                                                                                        | No           |
| App runtime timezone | [Set an app runtime timezone](#set-an-app-runtime-timezone) if you want your app runtime to use a specific timezone instead of the container timezone.<br />The app runtime timezone only affects your app itself.                                                                  | Yes          |
| Cron timezone        | [Set a cron timezone](#set-a-cron-timezone) if you want your crons to run in a specific timezone instead of the app runtime timezone (or instead of the container timezone if no app runtime timezone is set on your project). <br />The cron timezone only affects your cron jobs. | Yes          |
| Log timezone         | The timezone for all Upsun logs (UTC).                                                                                                                                                                                                                                              | No           |

<Note>
  Each Upsun project also has a **project timezone** that only affects [automated backups](/docs/environments/backup#automated-backups).
  By default, the project timezone is based on the [region](/docs/development/regions) where your project is hosted.
  You can [change it from the Console](/docs/projects/change-project-timezone) at any time.
</Note>

## Set an app runtime timezone

How you can set an app runtime timezone depends on your actual app runtime:

<Tabs>
  <Tab title="PHP">
    Add the following to your app configuration:

    ```yaml .upsun/config.yaml theme={null}
    applications:
      # The name of the app container. Must be unique within a project.
      myapp:
        # The location of the application's code.
        variables:
          php:
            "date.timezone": "Europe/Paris"
    ```
  </Tab>

  <Tab title="Node.js">
    Start the server with `env TZ='<TIMEZONE>' node server.js`.
  </Tab>

  <Tab title="Python">
    Start the server with `env TZ='<TIMEZONE>' python server.py`.
  </Tab>

  <Tab title="Java">
    Start the server with `env TZ='<TIMEZONE>' java -jar ...` OR set the Java virtual machine argument `user.timezone`.
    This Java virtual machine argument takes precedence over the environment variable TZ.
    For example, you can use the flag `-D` when running the application:
    `java -jar -D user.timezone=GMT` or `java -jar -D user.timezone="Asia/Kolkata"`
  </Tab>
</Tabs>

## Set a cron timezone

You can set a specific timezone for your crons so they don't run in your app runtime timezone (or container timezone if no app runtime timezone is set on your project).
To do so, [set the `timezone` top-level property](/docs/configure-apps/app-reference/single-runtime-image#primary-application-properties) in your app configuration.
