I’m trying to get the correct time for other timezones than the one I’m currently in on unity windows (v4.1.2). I try to use the TimeZoneInfo class from .net/mono. While the class exists, I’m not getting any timezones from the following code. I just get “0” in the log. (Using windows 7)
using System;
Debug.Log(TimeZoneInfo.GetSystemTimeZones().Count);
foreach (TimeZoneInfo z in TimeZoneInfo.GetSystemTimeZones())
Debug.Log(z.Id);
I read on the web that there was a bug in mono 2.6 on windows that lead to no timezones as I see it. It should be fixed now, but it seems Unity newer got that fix for the mono runtime. It’s annoying as the information is available in the windows registry
and according to the mono bug description it works on Mac and Linux (by using zoneinfo).
Has anyone successfully dealt with world timezones in some way inside unity?