Cron schedule is off on execution time

@Support

This may already be solved in a version already, but just in case I found a bug in 2.10.2.
I have not updated to the latest yet, so if it’s already solved, thank you!

I have a cron schedule for a job set to run every Monday at 6AM.
However, it ran at 2AM.

You can see the scheduled time shows correctly, but the next execution says 2AM.

Here is my settings:

Product: PowerShell Universal
Version: 2.10.2

Hi @Mike27,

I think this could be by design as the job was set to use default time (UTC) but the server is located in a timezone that is 4 hours earlier. I think if you try this again with the timezone set to match the server then it should work as expected.

Please let us know.

1 Like

Hello @DataTraveler ,

Is this a new setting? I have never had an issue with Cron scheduling until recently. I will check my other Cron schedules. I would think ‘System Default’ would be tied to the time zone the server is set to? I tried to adjust the time zone in the schedule and got an error:

image

Here is my settings:

Thank you,
Mike

EDIT: It looks like it may have been there awhile and I not notice, but before it was defaulting to my current time zone. Now after a specific update, it looks to be using System Default, however, I am unable to change it via the GUI. I did try to adjust it via the schedules.ps1 by changing it to ‘America/New_York’ and that worked. Not sure why I cannot adjust via the GUI.

Can we add an option in settings for default time zone please?

@mike27, I believe I’ve seen the issue you’re referring to (where the timezone setting shows as Default even though it is not) but I am not able to recreate it. It might only happen once per install and I would need to install fresh PSU to recreate it. However, it is just a display error. I do remember when I was seeing it that checking with Get-PSUSchedule showed the timezone was set correctly (despite the UI showing it as default).

I’ll see if I can recreate the display issue on a fresh install. Could @adam kindly advise about the intention of the “System Default” selection in the Timezone property of a PSU schedule? I am assuming it was intended to be UTC (GMT) but not sure.

Hello @DataTraveler & @adam

I may not have worded it correctly.
Definitely seems that ‘System Default’ is UCT (GMT) time. I am wondering if this is something new, as my old cron jobs I never set the time zone and it was set to ‘America/New York’. It would be nice if we can change the ‘System Default’ to a different time zone or adjust the default settings for jobs.

The other issue was I was not able to change the time zone through the GUI. I had to edit schedules.ps1 and it took a second to reflect those changes.

Thank you!

@DataTraveler - Can you open an issue for not being able to change the timezones via the GUI? That shouldn’t be happening.

I might consider opening an issue for the System Default timezone as well. It’s confusing that it’s not actually using the system default. I think if we default to UTC we should probably just say that in the UI.

1 Like