Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

PowerTip: Use PowerShell to Change System Time

$
0
0

Summary: Learn how to use Windows PowerShell to change the system time.

Hey, Scripting Guy! Question The clock on my computer (running Windows 8.1) is 30 minutes slow. How can I use Windows PowerShell 
            to move the system time up 30 minutes?

Hey, Scripting Guy! Answer Use the Set-Date cmdlet, create a TimeSpan object equal to 30 minutes, and supply it to
            the –adjust parameter:

Set-Date -Adjust (New-TimeSpan -Minutes 30)

To alter the clock back 30 minutes, create a negative TimeSpan, for example:

Set-Date -Adjust (New-TimeSpan -Minutes -30)

Note  This cmdlet requires credentials to set the time. One way to get this privilege is to open
Windows PowerShell as an administrator.


Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>