PowerShell TimeZone, Date and So On

Our Score
Click to rate this post!
[Total: 0 Average: 0]

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()

 

 

Our Score
Click to rate this post!
[Total: 0 Average: 0]

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

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