Closed PhloxDev closed 3 years ago
@PhloxDev there is documentation in README.md. Specifically this section shows an example of getting a time zone by name: https://github.com/srawlins/timezone#initialization-for-browser-environment.
I don't think this question has been answered. It's clear how to get the time zone object for an IANA time zone id such as America/Detroit, but the question appears to be asking how to get the time zone id itself in a web environment.
So I've looked around, and I don't think there is a way to get it with this library. If you're on web, then you need to use the ECMAScript Internationalization API. I don't think that there is a dart implementation for it, but you can simply write your JavaScript interop code for it.
If you're using flutter, then the package flutter_native_timezone
can expose it for you, and it now supports web as well.
I want to get current timezone name like Europe/london. how to get it?