Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get date and time from a NT 4.0 server? 1

Status
Not open for further replies.

jcanon

IS-IT--Management
Jun 7, 2001
33
CO
I need to get date and time from a Nt 4.0 server (I´m not using sql-server). Right Now I`m using :

!net time \\server /set /y

in order to sync local time and server time, and then I use the local sync time, but it shows and ugly DOS window.

Is there a best way to do that?
 
Unfortunately, that's the same way I'm doing it. There is an API call available to NT workstations, but I don't think there is anything available to Win9x. Should someone come up with something, I would love to see it, especially since that DOS box occasionally locks up one of the computers here. :eek:(
 
How to know date() from computer server ?
thread184-60819
Jon Hawkins
 
I've found the easiest "generic" way to get the time from any file server (NT, Novell, Unix, etc.) is to create a temp file and then read it's timestamp [with ADIR()] and then simply delete it.

Rick

 
Thanks !

I decide to use the idea of read the filestamp. The use of the API call is very good, but most of my stations are win9x
so I could not use that. I create two functions SDATE() and STIME() in order to replace Date() and Time()


#define NetDisk T:
Function sdate
_xDefa = SYS(5) + SYS(2003)
SET DEFA TO NetDisk
_xArchivo = SUBSTR(SYS(2015), 3, 10)
_xFHandle = FCREATE(_xArchivo)
= adir(_xdata, _xArchivo)
_xsFecha = _xdata(3)
fclose (_xFHandle)
delete file &_xArchivo
Set defa to &_xDefa
release _xArchivo, _FHandle, _xData, _xDefa
Return(_xsFecha)

Function stime
_xDefa = SYS(5) + SYS(2003)
SET DEFA TO NetDisk
_xArchivo = SUBSTR(SYS(2015), 3, 10)
_xFHandle = FCREATE(_xArchivo)
= adir(_xdata, _xArchivo)
_xsHora = _xdata(4)
fclose (_xFHandle)
delete file &_xArchivo
Set defa to &_xDefa
release _xArchivo, _FHandle, _xData, _xDefa
Return(_xsHora)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top