Hi All,
To get the correct timezone of the user I get the offset first using javascript:-
var offset =new Date().getTimezoneOffset();
and then I apply assign the value to the server side variable.
where I get the timezone using :-
ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
foreach (TimeZoneInfo timeZone in timeZones)
{
if (timeZone.BaseUtcOffset.Equals(offset))
{
return timeZone.Id;
}
}
Now the problem is that:-
- there are more than one timezones with same offset so how do I differentiate the timezone for the user.
- for GMT dublin,edingurgh,edson and london timezone there are two offsets depending on whether is allows day light saving mode(-60 and 0),how do I get the correct offset.
Any Ideas how I can get the correct timezone and offset?