# OTP 2FA Wrong Timezone

**URL:** <https://vaultwarden.discourse.group/t/otp-2fa-wrong-timezone/1853>\
**Category:** Help\
**Created:** [September 2, 2022, 12:26pm UTC](https://vaultwarden.discourse.group/t/otp-2fa-wrong-timezone/1853 "2022-09-02T12:26:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lfygame](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lfygame](https://vaultwarden.discourse.group/u/lfygame)\
**Post date:** [September 2, 2022, 12:26pm UTC](https://vaultwarden.discourse.group/t/otp-2fa-wrong-timezone/1853/1 "2022-09-02T12:26:55Z")

</div>

I just setup vaultwarden and wanted to enable 2FA. However the timezone in the webinterface is wrong (UTC in need MEZ or UTC+2). I reconfigured the container time via console however that did not changed anything in the web.

```auto
[2022-09-02 14:25:35.785][vaultwarden::api::core::two_factor::authenticator][ERROR] Invalid TOTP code! Server time: 2022-09-02 12:25:35 UTC

```

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [September 2, 2022, 12:48pm UTC](https://vaultwarden.discourse.group/t/otp-2fa-wrong-timezone/1853/2 "2022-09-02T12:48:03Z")

</div>

Check the `/admin` interface at the `Diagnostics` page.  
Either the host has a wrong time setting or you need to provide the correct `TZ=` variable.

---

<div class="post-metadata">

**Author:** ![lfygame](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lfygame](https://vaultwarden.discourse.group/u/lfygame)\
**Post date:** [September 2, 2022, 4:52pm UTC](https://vaultwarden.discourse.group/t/otp-2fa-wrong-timezone/1853/3 "2022-09-02T16:52:10Z")

</div>

I actually have the TZ in the env’s. The server time in diagnostics is correct as well. My raspberry’s time is correct as well `Fri 2 Sep 18:55:48 CEST 2022`

 ![image](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/f53dc0dcf5c72b795be8f8e6d3f3a0ea6f9c999a.png)

---

<div class="post-metadata">

**Author:** ![lfygame](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lfygame](https://vaultwarden.discourse.group/u/lfygame)\
**Post date:** [September 2, 2022, 4:59pm UTC](https://vaultwarden.discourse.group/t/otp-2fa-wrong-timezone/1853/4 "2022-09-02T16:59:36Z")

</div>

I recreated the container again i dont know why but it is fixed now!
