>I need to get the server date&time in order to set this date on my computer. I know that there is a way using the NET TIME command, but I would like to use an API fuction. Any Idea?
If you are using NT then you can read my FAQ on time synchronizing server and client machines. If you are using Win9X on your client systems, there is another approach.
Create a file using the low level file functions (LLFF) on the server. Use ADIR() to get the datetime of that file. The datetime will be determined by the server not the client that created it. Then use the SetLocalTime function of the WinAPI to set the time. The SetSystemTime function is documented in the API section here and the only change you need to make for SetLocalTime is the name of function. All parameters and structures are the same.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao