Do you need to know the timezone or just the offset from UTC? Because timezones are not an ISO standard and can be changed almost arbitrarily, I prefer to work with the client's offset from UTC and I always get it from the client at login time or whenever they submit a form on which I need the client time. Sometimes I work out the GTM offset of the client and persist it to use wherever I display or use a time.
So I have a global JavaScript function like this which returns the given local date as a universal string:
function aspClientDateTime(dateObject) {
return dateObject.getFullYear() + '-'
+ this.leadingZero((dateObject.getMonth() + 1), 2) + '-'
+ this.leadingZero(dateObject.getDate(), 2) + ' '
+ this.leadingZero(dateObject.getHours(), 2) + ':'
+ this.leadingZero(dateObject.getMinutes(), 2) + ':'
+ this.leadingZero(dateObject.getSeconds(), 2);
}
On form submit, I get the current client date and store it in the form:
myForm.clientTime.val(aspClientDateTime(new Date()));
You then know what time it is in the browser and you can work out UTC offsets etc on the server.
The problem with timezones is that any government could introduce a new one tomorrow, as Samoa recently did. Typically I want to know what the offset of the user is right now, not what timezone they are in.
If it is the latter you really need, you might have to ask them, in the same way that Skype does it.