Basically I can able to detect list of system time zones using following code:
foreach(TimeZoneInfo info in tz)
Debug.Log("time zone id : " + info.Id + " display name : " + info.DisplayName);
Running this code, I have following output in console.
In this list, I want to know, which one is my current system is following? Because I want specific information about that time zone. As like in following code, I was written clear “Asia/Kolkata”.
TimeZoneInfo infos = System.TimeZoneInfo.FindSystemTimeZoneById("Asia/Kolkata");
By running which code, I can able to get “Asia/Kolkata” as output?
EDIT: I was already using NodaTime here and code running for this purpose.
// Create a NodaTime DateTimeZoneSource object for IANA time zone names
var dateTimeZoneSource = TzdbDateTimeZoneSource.Default;
// Get the Windows time zone by name (or use TimeZoneInfo.Local)
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
// Convert between Windows and IANA time zone names
var tzdbTimeZoneInfo = dateTimeZoneSource.MapTimeZoneId(timeZoneInfo);
Console.WriteLine(tzdbTimeZoneInfo);
But in this, I am getting exception regarding,
I am using Mac system and editor as Mono Develop - Unity and my target devices are iPhones.