Get the current system time of the machine on the network

I understand that I can request the system time of my machine as follows:

from datetime import datetime datetime.now() 

Is there a way to request the system time of another computer on a Windows network? For example, \\mynetworkpc .

+6
python time networking system
source share
2 answers

there is net time \\<remote-ip address> on the windows machine to get the time on the remote machine, but I don’t know if it is ported.

 >>> import subprocess >>> subprocess.call(r"net time \\172.21.5.135") Current time at \\172.21.5.135 is 10/18/2010 12:32 PM The command completed successfully. 0 >>> 
+4
source share

You can combine the WMI PMI module with the answers to this question: get-remote-pcs-date-time

0
source share

All Articles