nlawalker
nlawalker

Reputation: 6514

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 timezone of the user its impersonating?

Upvotes: 2

Views: 609

Answers (1)

amit_g
amit_g

Reputation: 31250

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

Upvotes: 3

Related Questions