Hauptmenü

Timezone issue

Begonnen von disney, 29 September 2019, 23:54:41

Vorheriges Thema - Nächstes Thema

disney

I'm running FHEM on my Synology NAS and everything is pretty much great except I cannot change my time zone to anything other than UTC.

Actually, that's not strictly true. I can set the time zone as an environment variable and Perl seems to know it is set i.e. if I enter { $ENV{TZ} } into FHEM it returns Europe/London or BST depending on what I set. However, the FHEM logs and event manager reports times as UTC. Is this normal and if not, how do I change the timezone?

amenomade

What does { localtime() } say? (in command field of FHEM)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

disney


Currently I have TZ set and if i type "{$ENV{TZ}}"  into FHEM it returns "EUROPE/LONDON".

Running the command "{ localtime() }" at 8am returns "Mon Sep 30 06:59:57 2019" i.e. 1hour out.




Otto123


What does return
{qx(date)}inside the command line of FHEM?

Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

disney


It returns "Mon Sep 30 08:32:32 EUROPE 2019" at 9:33am




Otto123

#5
Its seems that the Timezone ist right?
May be DST ist wrong or the system time is wrong.
What returns this?
{qx(date +"%Z %z")}
or better
{qx(timedatectl)}


You are using ntp for time synchronisation?

All points inside the time configuration are right? I found this:
https://www.synology.com/en-global/knowledgebase/SRM/help/SRM/RouterApp/admin_time_region

It's important that not only the time shown at the surface ist right, also timezone and DST should be configured in the right way. There are many points for mistakes :)
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

disney



the command {qx(date +"%Z %z")} returns "EUROPE +0000".

The command {qx(timedatectl)} does not seem to return anything probably because Synology do not have a timedateclt executable.

The system date/time is set via NTP and at both the Linux level and within the Synology GUI reports the correct time.




Otto123

EUROPE ???
Europe has 4 timezones at minimum. I know only Timezone Names like Europe/London Europe/Berlin Europe/Moscow etc.

I think Daylight Saving Time is wrong +0000. No country in Europe  has no DST at this moment ;)

Whats's your right Timezone?

May be your system is misconfigured. You see the right time but the system is living far from you. ;)

Sorry I can't help you configure the synology, I found only the link in my older post.
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

disney



I'm in the UK i.e. "Europe/London" or BST timezone.

The Synology itself seems correctly configured and behaves as I expect.

Anyway for some reason I can now change the perl time zone. Maybe because I installed the perl package DateTime::TimeZone but I was trying a number of things as well.

So now if I run "export TZ=GMT-1" prior to starting FHEM I get the correct time in my logs. I know this in not the right TZ but for now it works and I am happy to leave it at for now.


Thanks for your help!


Otto123

I do not feel good about it. Keep in mind that your system seems to be twice bent.
You will be have similar effects every time if you use software wich depends on time and timezones like calendar and so on.
If you have time, may be you could do some investigation about configure the time in your system.
But I remind me, that synology is a little bit tricky. That is like system on a system - but may be I am not right.
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

disney



I looked at this again after sleeping on it.

For some reason the Synology sets /etc/localtime incorrectly to be "GMT0IST,M3.5.0/1,M10.5.0" i.e. India Standard Time when Europe/London is selected in the GUI.

The Synology apps obviously ignore /etc/localtime and use their own settings as they show the correct time.

So to get FHEM to work correctly I had to specify the TZ in full i.e. "export TZ=GMT0BST,M3.5.0/1,M10.5.0".


Again thanks for the help