Those who used to work a lot in the MS-DOS command prompt will usually move their work more and more to the PowerShell console . We have already reported in numerous articles about the possibilities of PowerShell, you will find a list of the most important PowerShell commands at the end of this article.
Today we would like to show you how you can set the Windows system date and time using the PowerShell console . To do this, you start a PowerShell console that must have administrative rights. With the following example you can set the Windows system time and the system date.
set-date “date time”
In our example “ set-date” 02.10.2018 19:00 “, as you can see below.
Successful execution of the Set-Date command is then briefly acknowledged by setting the date and time.
More set-date options
The “Set-Date” PowerShell command has some additional functions.
If you only want to set the date, you can also omit the time. Then the command is
set-date -date “date”
But be careful: In this case the system time is reset to “00:00:00” .
You can also simply increase or decrease the date by any number of days using the following PowerShell command
set-date (get-date) .adddays (NUMBER OF DAYS)
In this case, 7 days are simply added to the current date . You can also use minus days by simply placing a “-” sign in front of the number.
Below we have shown you some set-date PowerShell examples .
The same can be done with the time by using the following set-date command .
set-date -adjust-HOURS: MINUTES: SECONDS
Below you will find further useful PowerShell commands .
Show file rights with PowerShell – Read WindowsUpdate.log in Windows 10 or reformat with PowerShell – Install
Windows roles and features with PowerShell – Read out
computer system information with PowerShell
– Exchange quotas (quota) settings with PowerShell
– Windows with WINRM Prepare client for remote PowerShell commands
– Edit local users and groups with
– Determine Windows system runtime with PowerShell – Create Windows 10 system restore point with PowerShell
Shut down and restart Windows with PowerShell commands – Repair Windows component stores with DISM and PowerShell commands
– Switch off UAC (user account control) via PowerShell or registry in Windows 10
– PowerShell command to deactivate the firewall
– change the Windows timer (time) on a Windows server