So this is possibly a multi-part question. I want award users who log in every day, but base it upon their local timezone. We have a server in C# running in Mono where the award happens, so I want to transmit timezone to the server.
In the .Net world I can get information out of System.TimeZoneInfo.Local (DisplayName seems the smartest thing to use here, but it’s referred to as a “Windows format”).
I’ve found that System.TimeZoneInfo isn’t available on Android. There’s java.util.TimeZone, though I haven’t messed with JNI before, and I’m having some big problems getting there - I need to get an object reference through the static class function getDefault(), and then call getID() on that - which is a more Unix-ish format. Getting this to work was my original reason for coming here.
But now I’m wondering if it’s worth the effort, is my server in Mono going to be able to decode the Android timezone identifier? Is there a better way of doing this?
My fallback position will be to tease out the offset from UTC, but I’d much rather handle daylight savings transparently (or outlaw it across the globe). I suppose I could have the user input a timezone, but frankly this should not be my job to ask for it. The OS should be able to provide something useful (or perhaps wishful thinking, Unity could translate to some reasonably portable standard).
So what do people think?