Search Unity

The name 'TimeZone' does not exist in the current context

Discussion in 'Windows' started by Shadowing, Aug 5, 2017.

  1. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    While trying to do a Windows 10 build I'm getting this error for TimeZone
    SDK Universal 10

    Code (csharp):
    1.  
    2. int currentOffset = (int)TimeZone.CurrentTimeZone.GetUtcOffset( System.DateTime.Now).TotalSeconds;
    3.  
     
  2. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    also got another one I'm not sure about
    It doesn't like the JSONObject I'm passing in the agrument

    Code (csharp):
    1.  
    2. Assets/Politics.cs(255,39): error CS0012: The type `System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    3.  
    Code (csharp):
    1.  
    2.     static public void ShowLocationPicture(JSONObject planet_details_data, Image LocationPicture) {
    3.  
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,679
    As far as I know, TimeZone is not an available class on .NET scripting backend.

    Did you try using IL2CPP?
     
  4. DrunkReaperMatt

    DrunkReaperMatt

    Joined:
    Feb 11, 2013
    Posts:
    38