From 14139c37e6bbd87fa370e0fb3c75e5d437f3cc75 Mon Sep 17 00:00:00 2001 From: rlzicar <49433629+rlzicar@users.noreply.github.com> Date: Wed, 26 Feb 2020 16:22:28 +0100 Subject: [PATCH] Fix ToDateTime() always returning 01/01/1970 result.AddMilliseconds() doesn't change the value of result - it returns a new DateTime which was ignored and therefore ToDateTime() was always returning 01/01/1970 --- .../Platforms/Android/AndroidJavaConverter.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidJavaConverter.cs b/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidJavaConverter.cs index 23e72cd6a..d6acd9a82 100644 --- a/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidJavaConverter.cs +++ b/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidJavaConverter.cs @@ -30,8 +30,7 @@ internal class AndroidJavaConverter internal static System.DateTime ToDateTime(long milliseconds) { System.DateTime result = new System.DateTime(1970, 1, 1, 0, 0, 0, 0); - result.AddMilliseconds(milliseconds); - return result; + return result.AddMilliseconds(milliseconds); } // Convert to LeaderboardVariant.java#TimeSpan @@ -284,4 +283,4 @@ internal static TurnBasedMatch.MatchTurnStatus ToMatchTurnStatus(int matchTurnSt } } } -#endif \ No newline at end of file +#endif