Search Unity

DateTime string parsing throws exception after Unity 2019.1 update

Discussion in 'iOS and tvOS' started by ArnoldRauers_Tinytouchtales, May 31, 2019.

  1. ArnoldRauers_Tinytouchtales

    ArnoldRauers_Tinytouchtales

    Joined:
    Jan 25, 2015
    Posts:
    33
    Hi,

    i found a strange bug in my game. I updated from 2018.1 (.NET 2) to 2019.1. (.NET 4)
    I updated the game over the existing installation on my device.

    I have a UserPref string with a DateTime converted to string.
    When i try to use

    Code (CSharp):
    1. DateTime time = Convert.ToDateTime(dateTimeString);
    I'm getting a FormatException, the string is not a valid date.

    But when i deinstall and reinstall the game this error is gone.
    I suspect the DateTime string, saved in player prefs, that was created with the old version of Unity is not readable by the new updated version.

    Question:
    Did something (in .NET) change that makes this happen in regards to how DateTime strings are parsed in 2019.1?
     
    sarebots2 likes this.
  2. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
  3. ArnoldRauers_Tinytouchtales

    ArnoldRauers_Tinytouchtales

    Joined:
    Jan 25, 2015
    Posts:
    33
    @kaarloew thanks for the hint, i'll read more about this.