-DeferDeadline for client local time instead of UTC

Checking the logs on a test deployment and I’m wanting to set the deferral deadline for 10:00am client local time. For Show-InstallationWelcome I had -DeferDeadline "03/21/2023 10:00" and I see in the logs where that’s getting converted to UTC.
How can I tell the install that I want the 10:00 time to be client local time?

DISCLAMER: I don’t use Defer but I will try to help

PSADT has a function called Get-UniversalDate that does the conversion
From I can tell it doesn’t do consider time zones so it should be local time.

Get-UniversalDate -datetime  “03/21/2023 10:00”
Converting the date [03/21/2023 10:00:00] to a universal sortable date time pattern based on the current culture [].
2023-03-21 10:00:00 AM

IOW: “03/21/2023 10:00” ==> 2023-03-21 10:00:00 AM
not UTC

How would I pass that as an argument in my Show-InstallationWelcome string?

as per the Show-InstallationWelcome Function AppDeployToolkitMain.ps1

.PARAMETER DeferDeadline

Specify the deadline date until which the installation can be deferred.

Specify the date in the local culture if the script is intended for that same culture.

If the script is intended to run on EN-US machines, specify the date in the format: "08/25/2013" or "08-25-2013" or "08-25-2013 18:00:00"

If the script is intended for multiple cultures, specify the date in the universal sortable date/time format: "2013-08-22 11:51:52Z"

The deadline date will be displayed to the user in the format of their culture.

From what I can tell: -DeferDeadline "2023-03-21 10:00:00Z"

The Z at the end makes it UTC. You can see in the logs where it takes the deadline from the argument and converts it to UTC.

[Pre-Installation] :: Converting the date [03/21/2023 10:00:00] to a universal sortable date time pattern based on the current culture [en-US].
[Pre-Installation] :: The user has until [2023-03-21 10:00:00Z] remaining.

Just to reiterate, I don’t want it to conver the time to UTC. I want the 10:00AM deadline to be 10:00AM regardless of the time zone the client is in.

Z = Zulu time. That’s what I thought too.

So I did a test and my -5 Time zone did not change the time.

With the Z

Get-UniversalDate -datetime "2023-03-21 10:00:00Z"
Converting the date [03/21/2023 10:00:00] to a universal sortable date time pattern based on the current culture [].
2023-03-21 10:00:00 AM

Without the Z

Get-UniversalDate -datetime "2023-03-21 10:00:00"
Converting the date [03/21/2023 10:00:00] to a universal sortable date time pattern based on the current culture [].
2023-03-21 10:00:00 AM

If it was ZULU time, it would have returned 2023-03-21 05:00:00 AM

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.