pinkfish / flutter_native_timezone

Apache License 2.0
78 stars 156 forks source link

Get long timezone instead of three letter #15

Open deadsoul44 opened 3 years ago

deadsoul44 commented 3 years ago

I am calling an API with timezone parameter. However, timezone response from this library is three letter (e.g. GMT). But, the API is expecting long version timezone. Is there a way to specify this?

scopendo commented 3 years ago

If you're referring to the IANA time zone id, such as Europe/London, then I've been able to get that just by calling:

await FlutterNativeTimezone.getLocalTimezone();
REKURDennis commented 3 years ago

I have this problem on the Android Emulator, too. I had to explicitly set a timezone in the device settings, otherwise "GMT" is returned.

pinkfish commented 3 years ago

The emulator seems to return different timezone names than the real device (when I have tested it anyway).

jamesdixon commented 3 years ago

This also occurs when we upload our app to Browserstack for testing.

pinkfish commented 3 years ago

Do you know if there is a way to get the full timezone name from the system in these cases? Seems to be an issue with how the emulators setup the timezone, possibly tied to how they get out of the machine itself. This was the only call I could see that would get the timezone at the OS level?

On Tue, 25 May 2021 at 08:21, James Dixon @.***> wrote:

This also occurs when we upload our app to Browserstack for testing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pinkfish/flutter_native_timezone/issues/15#issuecomment-847963353, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATOMMJDQBQAB3KD4A5ENDDTPO6APANCNFSM4RCROZMA .

pinkfish commented 3 years ago

I switched the API to use ZoneId after looking around on the web a bit. Looks like this returns an iana timezone name more frequently...