You can use:
net time \\computer_name
You'll just need to shell out to this and parse the result.
Here's some sample code. It's in C#, but should be pretty easy to translate.
static DateTime GetRemoteDateTime(string machineName)
{
machineName = @"\\" + machineName;
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo("net", "time " + machineName);
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
p.WaitForExit();
string output = p.StandardOutput.ReadLine();
output = output.Replace("Current time at " + machineName + " is ", "");
return DateTime.Parse(output);
}
I didn't bother adding any error handling (if the machine is not found, etc) - you can add in whatever you need to suit your purposes.