I'm working on a linux embedded project built with buildroot tool and I'm using mono to run my .net application on linux system. It's necessary to have a custom table of daylight saving time periods. The user will insert manually the next few years periods(when daylight saving time starts and when it ends) in a GUI interface that I have done in .net, and the user is allowed to edit those periods if they change by the government. I know maybe there are other way to do that automatically, but like I said, it's necessary to have an user interface to set or edit it manually.
Before I was using this file as my zoneinfo information:
/usr/share/zoneinfo/America/Sao_Paulo
This file has the daylight saving time periods of São Paulo and Linux changes the system clock automatically when it starts, but I found out I can't edit this file, so it doesn't work for me. So I changed to:
/usr/share/zoneinfo/Etc/GMT+3
This file has my zoneinfo without daylight saving time periods. I'm planning to do it manually.
I did the GUI interface which saves the table of custom DST periods in mongodb database. My idea was to set the linux system clock one hour a head when I detect the current time is within of any period saved in my database. It also was working very well but the problem is when my NTP service synchronizes and updates the system clock, setting it to one hour behind back again. And of course, I can't disable the NTP service, I need this as well.
How can I implement this feature ? Is it better implementing this in Linux to do this task or in my .net application running on linux ?