C
Cameron Sutherland
There may be an easier way to do this but here goes. In
DOS you can get the time from a server on the network with
Net Time. you can output that and get the results:
Private Sub GetTime() as Date
Dim strLineRead As String
Dim intMyPos As Integer
Shell (Environ$("COMSPEC") & " /C net
time /domain:yourdomainname >>C:\gettime.txt")
Open "C:\gettime.txt" For Input As #1 'open text file
Input #1, strLineRead 'read the first line of text
Close #1 'close the text file
intMyPos = InStr(1, strLineRead, " is ", 1) 'get position
GetTime= Mid(strLineRead, intMyPos + 4, Len
(strLineRead) - intMyPos) 'strip out only date time
End Sub
-Cameron Sutherland
DOS you can get the time from a server on the network with
Net Time. you can output that and get the results:
Private Sub GetTime() as Date
Dim strLineRead As String
Dim intMyPos As Integer
Shell (Environ$("COMSPEC") & " /C net
time /domain:yourdomainname >>C:\gettime.txt")
Open "C:\gettime.txt" For Input As #1 'open text file
Input #1, strLineRead 'read the first line of text
Close #1 'close the text file
intMyPos = InStr(1, strLineRead, " is ", 1) 'get position
GetTime= Mid(strLineRead, intMyPos + 4, Len
(strLineRead) - intMyPos) 'strip out only date time
End Sub
-Cameron Sutherland