Discussion:
Getting server time - HELP!
(too old to reply)
g***@wwdb.org
2004-12-07 22:14:39 UTC
Permalink
Up until the swithover we were using the procudure below to get the
server time of a novell server, Now we are using a win2K server and
can't get this to work, any ideas?

Function ServerTime : Double;
{ Returns the file server clock as a number of hours since Midnight,
with no error checking. ($E7 does not return an error code)
}

Var
Regs : Registers;
ReplyBuffer : Array[0..6] of Byte;

Begin
Regs.AH := $E7; { Call to Novell API: Get File Server
Time }
Regs.DS := Seg(ReplyBuffer);
Regs.DX := Ofs(ReplyBuffer);
MsDos(Regs); { Give it to
DOS }
ServerTime := ReplyBuffer[3] + ReplyBuffer[4]/60 +
ReplyBuffer[5]/3600;
End;


The Regs stuff is returning zero, but I don't know what to replace the
$E7 with.

Thanks
Dan
Maarten Wiltink
2004-12-08 09:57:00 UTC
Permalink
Post by g***@wwdb.org
Up until the swithover we were using the procudure below to get the
server time of a novell server, Now we are using a win2K server and
can't get this to work, any ideas?
Function ServerTime : Double;
{ Returns the file server clock as a number of hours since Midnight,
with no error checking. ($E7 does not return an error code)
}
Var
Regs : Registers;
ReplyBuffer : Array[0..6] of Byte;
Begin
Regs.AH := $E7; { Call to Novell API: Get File Server Time }
Regs.DS := Seg(ReplyBuffer);
Regs.DX := Ofs(ReplyBuffer);
MsDos(Regs); { Give it to DOS }
Windows 2000 is not DOS.
Post by g***@wwdb.org
ServerTime := ReplyBuffer[3] + ReplyBuffer[4]/60 +
ReplyBuffer[5]/3600;
End;
The Regs stuff is returning zero, but I don't know what to replace the
$E7 with.
Type "Now", press F1, read help.

Groetjes,
Maarten Wiltink
guzzy
2004-12-08 16:28:48 UTC
Permalink
Post by Maarten Wiltink
Post by g***@wwdb.org
Up until the swithover we were using the procudure below to get the
server time of a novell server, Now we are using a win2K server and
can't get this to work, any ideas?
Function ServerTime : Double;
{ Returns the file server clock as a number of hours since
Midnight,
Post by Maarten Wiltink
Post by g***@wwdb.org
with no error checking. ($E7 does not return an error code)
}
Var
Regs : Registers;
ReplyBuffer : Array[0..6] of Byte;
Begin
Regs.AH := $E7; { Call to Novell API: Get File Server Time }
Regs.DS := Seg(ReplyBuffer);
Regs.DX := Ofs(ReplyBuffer);
MsDos(Regs); { Give it to DOS }
Windows 2000 is not DOS.
Post by g***@wwdb.org
ServerTime := ReplyBuffer[3] + ReplyBuffer[4]/60 +
ReplyBuffer[5]/3600;
End;
The Regs stuff is returning zero, but I don't know what to replace the
$E7 with.
Type "Now", press F1, read help.
Groetjes,
Maarten Wiltink
Win2k is the server, the workstations are DOS 6.22 booted from floppy,
using the ms ipxclient (lsl, netx, etc.)

The workstations then run my program which checks the server for the
time, using the above code (and a bunch of other stuff)

Best I can tell, the Now() function only gets the local machines time,
I want to sync the local machine to the server. How do I do that?

Dan
guzzy
2004-12-08 16:50:14 UTC
Permalink
Post by g***@wwdb.org
Post by Maarten Wiltink
Post by g***@wwdb.org
Up until the swithover we were using the procudure below to get the
server time of a novell server, Now we are using a win2K server and
can't get this to work, any ideas?
Function ServerTime : Double;
{ Returns the file server clock as a number of hours since
Midnight,
Post by Maarten Wiltink
Post by g***@wwdb.org
with no error checking. ($E7 does not return an error code)
}
Var
Regs : Registers;
ReplyBuffer : Array[0..6] of Byte;
Begin
Regs.AH := $E7; { Call to Novell API: Get File Server Time }
Regs.DS := Seg(ReplyBuffer);
Regs.DX := Ofs(ReplyBuffer);
MsDos(Regs); { Give it to DOS }
Windows 2000 is not DOS.
Post by g***@wwdb.org
ServerTime := ReplyBuffer[3] + ReplyBuffer[4]/60 +
ReplyBuffer[5]/3600;
End;
The Regs stuff is returning zero, but I don't know what to
replace
Post by g***@wwdb.org
the
Post by Maarten Wiltink
Post by g***@wwdb.org
$E7 with.
Type "Now", press F1, read help.
Groetjes,
Maarten Wiltink
Win2k is the server, the workstations are DOS 6.22 booted from
floppy,
Post by g***@wwdb.org
using the ms ipxclient (lsl, netx, etc.)
The workstations then run my program which checks the server for the
time, using the above code (and a bunch of other stuff)
Best I can tell, the Now() function only gets the local machines time,
I want to sync the local machine to the server. How do I do that?
Dan
Some further thinking on the subject:

I do have the Win2K server setup as a localNTP server, so how would I
(in pascal code please) pull the time from the NTP server? Remember
this is from a DOS machine.

Dan
Maarten Wiltink
2004-12-08 19:50:06 UTC
Permalink
"guzzy" <***@wwdb.org> wrote in message news:***@f14g2000cwb.googlegroups.com...
[...]
Post by guzzy
I do have the Win2K server setup as a localNTP server, so how would I
(in pascal code please) pull the time from the NTP server? Remember
this is from a DOS machine.
Doesn't "net time" work? Otherwise, I'm really out of my depth with
DOS machines. NTP should work nicely and a simple SNTP query/response
shouldn't be hard, but I just don't know how to make it work with DOS
only. Delphi especially doesn't run on it.

Groetjes,
Maarten Witlink

Continue reading on narkive:
Loading...