flutter_native_timezone icon indicating copy to clipboard operation
flutter_native_timezone copied to clipboard

Get long timezone instead of three letter

Open deadsoul44 opened this issue 5 years ago • 6 comments

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?

deadsoul44 avatar Sep 09 '20 15:09 deadsoul44

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();

scopendo avatar Jan 25 '21 19:01 scopendo

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

REKURDennis avatar Feb 28 '21 13:02 REKURDennis

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

pinkfish avatar May 13 '21 01:05 pinkfish

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

jamesdixon avatar May 25 '21 15:05 jamesdixon

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 avatar May 25 '21 17:05 pinkfish

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...

pinkfish avatar May 26 '21 16:05 pinkfish