I'm trying to convert a timestamp string with the format:
Wed Jun 15 08:38:07 NZST 2022
(where 'NZST' is the time zone name)
Using PowerShell I've got close to a solution but can't work how to recognise the time zone code. Trying using 'zzzz' (and in uppercase) to mark the portion of the string with the time zone in it:
[DateTime]::ParseExact($stampy, "ddd MMM dd HH:mm:ss zzzz yyyy", $null)
But this gives the error: Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
Is there a solution to this using ParseExact or will I need to split the string and decode the time zone code separately?
Thanks