I want Client timezone name (e.g. India Standard Time) in ASP.Net MVC Application.
So, I Can use TimeZoneInfo.FindSystemTimeZoneById(TimeZoneName) function.
I have tried with new Date().getTimezoneOffset() (reference)
But, there is problem with Daylight Saving Time in this Code.
In javascript, i have also tried with new Date().toString()
But, this gives result in different format with different browser.
In firefox, chrome & safari,
Answer is “Tue May 08 2012 14:00:00 GMT+0530 (India Standard Time)”
In IE8, it is “Tue May 8 14:00:00 UTC+0530 2012”
Similar problem with opera also.
So, this method will not work for IE & Opera.
What will be best way to identify Client TimeZone?
the best and the most utilized way is to identify clients location thru some 3rd party library and database utilizing the ip of the client.. and then based upon the location of the client decide the timezone