macadmins / nudge

A tool for encouraging the installation of macOS security updates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Local Time specification not working - Nudge reads it as UTC

swissarmygeek opened this issue · comments

I am doing some testing with a requiredInstallationDate of "2024-04-12T15:00:00" (and local time was 11am CDT) and Nudge is immediately going into 'elapsed' behavior.

In other words, it is interpreting the time as UTC (15:00 UTC = 10am CDT), even though I don't have a "Z" at the end.

Is this a macOS or Swift issue (ie no longer interpreting the time as 'local time') or a Config Profile issue? It was two different Macs - one Sonoma, one Ventura. I am using the custom schema for my config profile - could that be the problem?

-Don

Is it a <string> or a <date> in your config profile? For zoneless, it needs to be a string.

It's a string:
2024-04-12T15:00:00

I tried adding .000 to it per ISO 8601 - Nudge reports "Hours remaining: 0" but does not go to Elapsed mode, so I don't think that works at all. I changed it to 2024-04-12T12:00:00.000 and it does the same thing.

But is it declared as a string type in the actual plist?

Yes - sorry, I guess github stripped that - copied directly from -print-profile-config: "<string>2024-04-12T15:00:00</string>"

This seems to affect recent versions of Nudge only. I downgraded to 1.1.10.81462 and it behaves as expected - e.g Hours Remaining: 2

1.1.13.81510 works as expected
1.1.14.81549 (and later versions) - goes directly to 'elapsed' behavior
I think that means something about the 1.1.4 code refactor has changed how dates are interpreted

Just want to add that we're having the same problem where adding or removing the Z makes no difference, it resorts to UTC no matter what. Running 1.1.14.81546 with the elapse date set as a string. Just one of the few issues that have crept up since setting up Nudge to update automatically with Jamf Mac App catalog.

I just want to state that local timezone was never actually supported and someone discovered by accident that it could work.

It's likely the calendar code change in v1.1.14 stopped this from working.

8707bd5

With this, I believe I have fixed it for both mdm profiles and json.

You can now pass something like 2025-01-01T00:00:00Z for UTC and 2025-01-01T00:00:00 for local time.

If you are using a MDM profile and passing the original Date key, this will not work, as it is ISO8601 standard and forces you to put a timezone in (at least Xcode does). So this only works for profiles and json when you are passing a string for requiredInstallationDate