PowerShell Quick Tip: How to convert local time to UTC. This is useful when you run Powershell against systems in different timezones and don’t want to deal with client local time.
The [DateTime] object in PowerShell have the ToUniversalTime() method, which converts the current time of the object to UTC time.
The local time of my computer is UTC+1, and the content of $DateTime contains that time. But executing the method ToUniversalTime() on $DateTime now shows the UTC time instead.