RotherOSS / otobo

OTOBO is one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. https://otobo.io/
GNU General Public License v3.0
261 stars 75 forks source link

GenericAgent Jobs run at wrong time if OTOBOTimeZone is not UTC #1187

Open wetzf opened 3 years ago

wetzf commented 3 years ago

Hello OTOBO Team,

if i set OTOBOTimeZone to "Europe/Berlin" all my Generic Agent jobs with automatic execution run two hours too late. For example if i set them to run at 10:05 they run at 12:05.

The server uses "Europe/Berlin" as its system timezone and is synchronized via NTP. The jobs were created by a user that used "Europe/Berlin" as well.

I tested this using OTOBO 10.0.11.

Kind regards Frank

svenoe commented 3 years ago

Hi wetzf,

we will have a look at this after 10.0.12.

Best regards, Sven

bschmalhofer commented 3 years ago

Maybe related: https://github.com/znuny/Znuny/commit/cac5e9a437b4839d571850b0e3fee849a6ea6c0c

bschmalhofer commented 3 years ago

Hi Frank,

I have take a look at this issue and set up a generic agent task on a test system with OTOBOTimeZone set to Europe/Berlin. My observations are consistent with yours. The hours and minutes that are set in the "Generic Agent Job Management" admin page are interpreted as being given in UTC. This explains the offset of two hours to Central European Summer Time. The time zone UTC is hard coded. This means that it isn't influenced neither by the configured OTOBO Time Zone nor be the system time zone.

There are valid reasons for this design decision. IMHO it is a good idea to not depend on the system time of the server. The downside is that it not trivial to set up jobs, that run relative to the OTOBO time zone, or any other specified time zone.

One real problem is the documentation. Time zones are not mentioned at all in https://doc.otobo.de/manual/admin/stable/en/content/processes-automation/generic-agent.html. And the note "Automatic execution values are in the system timezone. " in the admin GUI is just plain wrong.

@svenoe I propose to stick with UTC for the time zone in which generic agent jobs are set up. But the documentation needs to be fixed and enhanced. What do you think?