How to enable Daylight Savings Time

Are there any field flags to enable Daylight Savings Time (within PLCNext Eng or within Linux). The objective is to show off the time on the HMI display and also to datetime stamp records on logs. Without it, one must change time manually 2x a year. Currently programming on a AXC F 2152 using firmware 2020.3.1. See that should be updating to 2020.6 for fixes to the time zone fields.

Hello, You can set the local time zone in Linux as follows: 1. Update the /etc/localtime symbolic link: sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime 2. Change the contents of the file /etc/timezone from “Universal” to the exact name the file in the /usr/share/zoneinfo directory, e.g. America/New_York (Obviously, in both of the above, swapping America/New_York for a suitable file in the /usr/share/zoneinfo directory). To check the result: date # shows the local time and time zone date -u # shows universal time The zoneinfo file includes daylight savings information, so any clock that uses local time should automatically adjust. I am not sure if this will do what you want - it depends what HMI you are using, what PLC variable you are using to display the time, and what log file(s) you are referring to. For example, the Output.log file in the /opt/plcnext/logs directory always stamps its records with UTC, regardless of the local time zone.






Oh, and you should consider updating the firmware and PLCnext Engineer to at least the latest LTS version + hotfix (currently both 2021.0.2).

Is it possible to configure local time (i.e. GMT +2) and obtain this local time programmatically, so as to display it on HMI pages?

Now I get UTC time using RTC variable, and then add necessary number (i.e. 2 to get GMT+2) to HOURS variable. But that’s definitely not the cleanest solution.

The PLCnextBase library has some time conversion functions that might be suitable.

For more information on that library, please contact the library developer through the PLCnext Store.