TimeZone.CurrentTimeZone in an ASP.NET app
How does TimeZone.CurrentTimeZone work if run in an ASP.NET app? Does it return the timezone of the application pool running the application? If using impersonation, does it return the timezo开发者_Go百科ne of the user its impersonating?
It is the time zone on the computer where the code is executing. This is stored in HKLM i.e. it is a machine level setting not a user level. So it doesn't matter if impersonaltion is used. The value would still be the same. Check TimeZone.CurrentTimeZone which is TimeZoneInfo.Local
精彩评论