Check Time/Date on a server

I have two servers which are not in sync.

I need to write a script that checks the time on the corresponding server and another script to call the above script on both the servers simulataneously to check if there is a time difference.

Can anyone provide me with such scripts as I am new to Unix ?

Do you know about NTP - usually running an xntpd daemon. NTP detects time differences between servers and corrects them.

Can you please elaborate a little more about this as I have no clue about NTP....

NTP: http://en.wikipedia.org/wiki/Network\_Time_Protocol
Reference Implementation: http://www.ntp.org/

As soon as you've got the daemon up and running, choose a geographically close server pool from http://www.pool.ntp.org/