+4 votes
70 views
Change Date and Time Windows Server 2022 2019, 2016 CMD or PowerShell

in WindowsServer by (551k points)
reopened | 70 views

1 Answer

+5 votes
Best answer

1. Change Date and Time Windows Server 2022 2019, 2016 from CMD
2. Change Date and Time Windows Server 2022 2019, 2016 from PowerShell

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:

 

image

 

Step 2

We will use the following syntax to change the time on the server:
 time HH/SEC/MIN AM/PM 
image

 

Step 3

In this case we have established a PM time, we validate that the change has been applied:

 

image

 

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:

 

 

image

 

step 5

We validate the change:

 

image

 

step 6

To change the date in Windows Server from CMD, we are going to use the following syntax:
 date MM-DD-YY 
image

 

step 7

Validate the change in the taskbar:

 

image

 


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:

 

image

 

Step 2

We list the current date with the command:
 get-date 
image

 

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” 
image

 

Step 4

Now we validate the date and time change:

 

image

 

step 5

In the console we can list the current time zone:
 get-wmiobject win32_timezone 
image

 

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.

 


by (3.5m points)
edited

Related questions

+5 votes
1 answer
+4 votes
1 answer
+4 votes
1 answer
+5 votes
1 answer
+4 votes
1 answer
asked Oct 1, 2020 in Windows 10 by backtothefuture (551k points) | 252 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,632 questions
10,764 answers
510 comments
3 users