Windows Server plays an essential role in organizations of all kinds thanks to each of its functions, roles and characteristics that allow comprehensive, global and functional administration of each object of the organization, we are talking about users, computers, printers, shared resources and plus..
When Windows Server 2016, 2019 or 2022 is installed, the time and date are assigned based on the user's location, this is something natural in this process but there may come a time when it is necessary to change the date and time for some task administrative or because the server changes its geographical location, be careful not to do this operation in an environment where the users are still working, since we can cause access problems to the shared resources.
There is the possibility of changing the date and time from CMD or PowerShell and we will see how to achieve it in Windows Server, in this case version 2022 but it applies equally to other versions..
To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE
1. Change Date and Time Windows Server 2022 2019, 2016 from CMD
First of all we open CMD, this will open as administrator by default in Windows Server:
We will use the following syntax to change the time on the server:
time HH/SEC/MIN AM/PM
In this case we have established a PM time, we validate that the change has been applied:
It is possible to use the 24-hour format without the AM/PM, we just have to enter the time in that format in the console:
We validate the change:
To change the date in Windows Server from CMD, we are going to use the following syntax:
Validate the change in the taskbar:
2. Change Date and Time Windows Server 2022 2019, 2016 from PowerShell
Now it is time to use the PowerShell console, for this we open PowerShell, it will open with administrative privileges by default:
We list the current date with the command:
Modify the date and time with the following command on a single line:
set-date -date “day, # day of month of year HH:MM:SS”
Now we validate the date and time change:
In the console we can list the current time zone:
In case it must be modified, it will be necessary to use the tzutil command for it.
This is the way we can change the date and time in Windows Server from CMD or PowerShell.