I’m trying to figure out if the System.TimeZoneInfo is a local user or system wide setting? I’ve been modifying my local timezone as the user i’m logged in as, but a service running in the background as system that is logging the timezone seems to continually log the old time zone. If the TimeZoneInfo is per user, then is there a way I can lookup the list of timezones for all users?
I’m trying to figure out if the System.TimeZoneInfo is a local user or system
Share
I assume you’re really talking about
TimeZoneInfo.Local? I believe that’s a system-wide setting but it’s cached on a per-process basis. You can callTimeZoneInfo.ClearCachedData()to force a refresh – although obviously you’ve got to know to do so 🙂 If you’re running a background task which needs to pick up on changes, you could always just call it once every 5 minutes… I don’t think that would be a huge performance hit, if you can live with it being stale for up to 5 minutes.(It seems odd to me that changing the system time zone doesn’t appear to require privileged access – in Windows 7 at least – but hey…)