One-Time Schedules ignoring Time Zone?

Product: PowerShell Universal
Version: 1.5.0

Selecting a one-time schedule seems to be either ignoring the time zone, or using UTC time to determine the time. When I click “Now” on the date/time picker, it shows the correct time however, when I save the schedule it shows 7 hours ahead. I’m in Arizona which is UTC-7 (we’re our own Time Zone as we don’t do Daylight Savings Time). In the Schedules.ps1 each line seems to correctly show.

-TimeZone "America/Phoenix"

However, in the same line it shows the UTC equivalent along with a Phoenix time zone. In other words, if I create a one-time schedule to run at 9:32am in the date/time picker, the schedule will get created for 4:32pm. When I view the Schedules.ps1 it looks like the below:

New-PSUSchedule -Description "Runs one time." -Script "Test.ps1" -TimeZone "America/Phoenix" -OneTime "11/23/2020 4:32:00 PM"

(Side note: When I try to set a schedule for 7 hours in the past to compensate, I get a “Schedule created successfully!” message but no schedule gets created)

I’ve opened an issue for this in our tracker to investigate. Definitely a bug.

1 Like

Thanks for being so quick to respond, Adam! The scheduling feature is the main reason I’m interested in the software, so I’m anxious to see it functioning!

This has been fixed in the main and will be in tonight’s nightly build. You’re welcome to try it. Otherwise this will be released in 1.5.3 next week.

Universal Nightly Builds (windows.net)