Most consistent way to handle Timezones (plus JNI help)

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?

Hi, i encountered the same problem (Android not having System.TimeZoneInfo informations at all).
Have you found any solution to your problem (specifically how to use java.util.TimeZone)? Any hint or example would be great!

i used in the end.

Im having the same problem. Im using windows all the methods from System.TimezoneInfo are throwing erros. The System.TimeZoneInfo.GetSystemTimezone should be returning tons of timezones, its returning 0. i really dont know how can i keep working on my app without this function. and the only complaint about it is this page. i hope someone can show us some light.