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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Time?

Status
Not open for further replies.

gieboy

Programmer
Feb 15, 2001
20
0
0
PH
Ive made an application using winsock to connect to a computer. How can I get the system time of the computer that im connecting in? Please help.
 
Are you able to send data back and forth to the other computer?

If so, then send a request to it telling it to send you it's time.

Client -> SENDDATETIME
Client -> DONE
Server <- DATETIMEIS 2001-06-02 13:15:12 EDT
Server <- DONE

The key is having both sides agree on how they're going to communicate. And after that, have them agree on a data format. It's best to use strings because if you use numeric formats (ints, longs, doubles, etc), it's possible the other computer isn't using an Intel CPU. For example, PowerPC and Sparc CPUS use a different format than Intel chips to represent numbers. Using a string gets around this problem.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top