Unity 2018.2.0b3.
I’m creating a project in Unity, on .NET 4.6 in C#, using IL2CPP. I need to get the UTC Offset of the user in seconds, and to do so I am using the following code:
UserData.Offset = (float)(System.DateTime.Now - System.DateTime.UtcNow).TotalSeconds;
When I trace out the values of DateTime.Now and DateTime.UtcNow, they are completely correct in editor (I’m in the AEST timezone, so a +10 hour offset). When I attempt the same on iOS and Android (a model of iPad and an Xperia XZ), the UtcNow value returns correctly, but the Now value is always an hour forward (+11 hour offset). This doesn’t make any sense at all, as we should not be in DST.
I have attempted calling;
System.Globalization.CultureInfo.CurrentCulture.ClearCachedData();
But this does not change the values at all.
Where is the fault at? This is a pretty critical part of the app which I need to resolve asap.