PowerShell TimeZone, Date and So On

If someone ever wondered how to change time, timezone or date in a powershell session or in a core server here is how.

If today is 27 May 2017 and we want to set the clock to 16:12:

Set-Date -Date “5/27/2017 16:12”

More on this here.

If only the timezone needs to be changed lets say to Central European:

Set-TimeZone -Id “Central European Standard Time”

List of all time zones could be obtained in powershell with the following command (Thank you scriptingguy you are priceless):

[System.TimeZoneInfo]::GetSystemTimeZones()

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.