I want to convert Indian DateTime object to Eastern DateTime object. Means I want to change time zone of particular DateTime object. For this I have written following code:
string easternZoneId = "Eastern Standard Time";
TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById(easternZoneId);
string indianZoneId = "India Standard Time";
TimeZoneInfo indianZone = TimeZoneInfo.FindSystemTimeZoneById (indianZoneId);
DateTime d = TimeZoneInfo.ConvertTime (DateTime.Today, indianZone, easternZone);
When I try to run this statement I am getting, following exception in Console.
How to run this code? I want to convert my time into eastern time.
EDIT: Right now I am running my code in Unity Editor. I have iMac system. I want to run this code for iPhone devices.