Why TimeZoneInfo (found in system namespace) doesn’t find time zones on Unity? Doesn’t mono support it? I’m using Windows.
The following code prints only 0:
using UnityEngine;
using System.Collections;
using System;
using System.Collections.ObjectModel;
public class Timezones : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log(TimeZoneInfo.GetSystemTimeZones().Count);
foreach (TimeZoneInfo z in TimeZoneInfo.GetSystemTimeZones())
Debug.Log(z.Id);
ReadOnlyCollection<TimeZoneInfo> tzCollection;
tzCollection = TimeZoneInfo.GetSystemTimeZones();
foreach (TimeZoneInfo timeZone in tzCollection){
print(timeZone.Id+":"+ timeZone.DisplayName);
}
}
}