Time of Nextcloud instance not correct

Hi everybody,

I noticed a while back, that when synchronizing my calendar with my phone, the time of my events is always off by 2 hours.

When I tried to fix the problem, I noticed that the time under settings -> locale is off by 2 hours. Curiously, the 2 hours are the exact offset between UTC and my timezone CEST. :upside_down_face:

Now I don’t know why I have this offset, and I don’t know if its because of the system time of my host system, the time of the php instance or the database or something else all together…

I checked the time of my host system, and it seems to be correct. Now I don’t seem to find any setting in the config.php to configure the timezone. How does my Nextcloud instance know my timezone, and how can I set the correct timezone for my instance?

Thanks in advance for any help!

Nextcloud version: 15.0.5
Operating system and version: Ubuntu 16.04.06 LTS
Apache version: 2.4.39
PHP version: 7.2

1 Like

You should check if the time on your server is correctly set and how the logtimezone parameter is set in your Nextcloud configuration file.

Sadly changing the logtimezone did not help. The time of the system is set correctly, I double checked that.

I figured out what was wrong. It was not the timezone of the host system being off, but it was my browser reporting the wrong time. When I opened the console in the browser, and ran Date() the timezone and time I got back was wrong. Turns out Nextcloud relies on the timezone reported by the browser, which makes sense thinking about it.

If anyone else has this problem, a possible cause for your timezone in Firefox being wrong is if you have privacy.resistFingerprinting enabled in about:config.

3 Likes

This is not a real solution. I am not going to turn off that feature, it protects my safety. but I am also being driven insane by the fact that the calendar and deck app is always wrong in nextcloud.

2 Likes

There’s an issue on Github for this: Unable to correct time zone in Nextcloud with privacy features enabled in browser, and no way to specify a specific time zone to operate in if desired · Issue #19006 · nextcloud/server · GitHub

1 Like

@ratm113 Thank you for discovering the cause of the problem! Although, I wish I didn’t have to decrease security in Firefox to get the time working in Nextcloud.