I want to get client timezone id from JavaScript to parse c# TimezoneInfo class.And Convert to utc time.And I have this
var timezone = String(new Date());
return timezone.substring(timezone.lastIndexOf('(') + 1).replace(')', '').trim();
Problem is some time it will javascript timezone return CST. Is there a proper way to get timezone id
and from the c#
TimeZoneInfo ZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZoneIdFromJavascript);
return TimeZoneInfo.ConvertTimeToUtc(Datetime, ZoneInfo);'