# Timezone

**URL:** https://hub.mender.io/t/timezone/3542
**Category:** Apply Device Configuration Scripts
**Created:** [April 23, 2021, 9:12am UTC](https://hub.mender.io/t/timezone/3542 "2021-04-23T09:12:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)
#### Post date: [April 23, 2021, 9:12am UTC](https://hub.mender.io/t/timezone/3542/1 "2021-04-23T09:12:08Z")

</div>

## Description

The **timezone** apply-device-config script sets the device’s timezone using the value of the `timezone` key from the Device Configuration.

## Specification

| | |
| --- | --- |
| Script name | timezone |
| Configuration key(s) evaluated | timezone |
| Version | 1.0.0 |
| Source code | [Script](https://github.com/mendersoftware/mender-configure-module/blob/1.0.0/scripts/timezone) |
| Maintainer | [Northern.tech](https://tracker.mender.io) |

**Please be aware that Mender apply-device-config scripts are meant to update and configure parts of the operating system and if not configured properly they could potentially delete parts or the complete operating system. Always inspect the code carefully and only test scripts on devices that you can recover easily.**

## Prepare the device

This section describes how to setup your target device, i.e. the device to be configured. This will also be referred to as the device environment.

All commands outlined in this section should be run in the device environment.

### Prerequisites

This apply-device-config script has the following prerequisites for the device environment:

- [Install the Mender client](https://docs.mender.io/client-installation/install-with-debian-package), version 2.6 or later
- [Install the Mender Configure update module](https://hub.mender.io/t/mender-configure-update-module/3529)
- Availability of the `timedatectl` command

### Install the apply-device-config script

#### Debian family

The `timezone` apply-device-config script is available in the Mender APT repository. Follow instructions in [Mender Docs to install the repository](https://docs.mender.io/downloads#install-using-the-apt-repository) in your device. Then, install `mender-configure-timezone` with:

```bash
sudo apt-get update
sudo apt-get install mender-configure-timezone

```

#### From source

Alternatively to all the above, it is possible to install from source. Follow these steps:

```bash
mkdir -p /usr/lib/mender-configure/apply-device-config.d && wget -P /usr/lib/mender-configure/apply-device-config.d https://raw.githubusercontent.com/mendersoftware/mender-configure-module/1.0.0/scripts/timezone && chmod +x /usr/lib/mender-configure/apply-device-config.d/timezone

```

## Usage

You can now set the device’s timezone setting the `timezone` configuration key in the Device Configuration.

While all values from `timedatectl list-timezones` will work, to easily see the impact of the changed value you can use one of the following values:

- `Europe/Oslo`
- `America/Los_Angeles`
- `Asia/Tokyo`

Once the configuration has been applied you can see the effect by connecting to the Device’s terminal, either via SSH or using the Remote Terminal, and executing the `date` command.

---

<div class="post-metadata">

### Author: ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)
#### Post date: [April 23, 2021, 9:19am UTC](https://hub.mender.io/t/timezone/3542/2 "2021-04-23T09:19:37Z")

</div>


