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
Step 1
First of all we open CMD, this will open as administrator by default in Windows Server:
Step 2
We will use the following syntax to change the time on the server:
time HH/SEC/MIN AM/PM
Step 3
In this case we have established a PM time, we validate that the change has been applied:
Step 4
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:
step 5
We validate the change:
step 6
To change the date in Windows Server from CMD, we are going to use the following syntax:
date MM-DD-YY
step 7
Validate the change in the taskbar:
2. Change Date and Time Windows Server 2022 2019, 2016 from PowerShell
Step 1
Now it is time to use the PowerShell console, for this we open PowerShell, it will open with administrative privileges by default:
Step 2
We list the current date with the command:
get-date
Step 3
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”
Step 4
Now we validate the date and time change:
step 5
In the console we can list the current time zone:
get-wmiobject win32_timezone
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.