PowerTip: Use PowerShell to Change System Time

PowerTip: Use PowerShell to Change System Time

  • Comments 2
  • Likes

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.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Great tip. Never thought of this!