Please help in converting time zone using powershell when source time is property of an element

Viewed 31

Somebody please help me in converting the time zone as said in the description. A little explanation on code will be great help in understanding the concept. Thanks in advance!

PS> Get-HotFix -id KB4537572 | select InstalledOn

InstalledOn
-----------
3/4/2020 12:00:00 AM


PS> $from = (Get-HotFix -id KB4537572 | select InstalledOn)

PS> $from

InstalledOn
-----------
3/4/2020 12:00:00 AM


PS> $to = 'Central Europe Standard Time'

PS> [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId( $from , $to )
Cannot find an overload for "ConvertTimeBySystemTimeZoneId" and the argument count: "2".
At line:1 char:1
+ [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId( $from , $to )
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest
0 Answers
Related