Environment: WinXP CMD (CMD Ver 5.1.2600)
I need to synchronize the time with a computer named A1 (192.168.0.112) in the network, and then change the local time to be the same as A1's.
However, after I used net time, the output text is in the following format.
I filtered out 09 and 47, and also imported them into the system.
But the current time is more than 9 PM, that is, more than 21:00.
Ask experts if there is a way to change 09 to 21.
Do not use third-party tools.
The batch script I wrote is as follows:
After running $Newtime.bat$, the system time becomes 9:00 something.
[ Last edited by voiL on 2005-11-9 at 20:18 ]
I need to synchronize the time with a computer named A1 (192.168.0.112) in the network, and then change the local time to be the same as A1's.
However, after I used net time, the output text is in the following format.
The current time of \\192.168.0.112 is 2005/11/8 9:47 PM
The command completed successfully.
I filtered out 09 and 47, and also imported them into the system.
But the current time is more than 9 PM, that is, more than 21:00.
Ask experts if there is a way to change 09 to 21.
Do not use third-party tools.
The batch script I wrote is as follows:
net time \\192.168.0.112>%temp%\$112$.tmp
FOR /F "tokens=5,6* delims=: " %%a in (%temp%\$112$.tmp) do (Set voltime=%%a%%b) & echo time %%a:%%b>%temp%\$Newime$.bat
Start %temp%\$Newtime$.bat
Del /Q %temp%\$Newtime$.bat
After running $Newtime.bat$, the system time becomes 9:00 something.
[ Last edited by voiL on 2005-11-9 at 20:18 ]
