获取用户和服务器时间之间的时差?

I want to have a feature where the user can set that he wants some daily reports to be sent to him every day at H:mm AM/PM his time.

I must then determine what time it will be on the server when its the specified time for the user. E.g if the user put 5:00 PM as the time when he wants emails to be sent, and its currently 12:00 PM for him while on the server its currently 10:00 PM, I want to determine what time it will be on the server when its 5:00 PM for the user.

How can I achieve this using PHP / Javascript?

I was thinking of generating a MySQL TIME string (e.g hh:mm:ss) via javascript, of the current user's time, passing it to the server, which would use this string in a mysql query and do TimeDiff() on it? Or is there any better method?

Note: The client has specified that the user's clock time must be used, and not his current timezone.

In your Ajax query on the end of your url I'd do something like:

var ts = Math.round((new Date()).getTime() / 1000);
var url= "http://mysite.com/?usertime="+ts;

Then on the server side you could use something like

$EstimatedTimeDifference = time()-$_GET['usertime'];

So now you've got the time difference in seconds between the server and the browser's time (roughly, ignoring the time it took for the script to generate the time()). From there, it should be fairly easy. Round it and divide it by 3600 to get the amount of hours difference etc.

Is that enough information to get you going?