Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get locale code from zone name? #5645

Closed
Soullighter opened this issue Jul 9, 2020 · 3 comments
Closed

How to get locale code from zone name? #5645

Soullighter opened this issue Jul 9, 2020 · 3 comments

Comments

@Soullighter
Copy link

I was trying to find how to get code fr from zone name ’Europe/Paris' all day, but with no luck.

I read all docs and couldn't find that function either, so i need help on this one.

Closest what i found is this. I need This function but in reverse, to pass country name and get country code.

@cmalard
Copy link

cmalard commented Jul 10, 2020

@Soullighter
Copy link
Author

Soullighter commented Jul 10, 2020

That is great, but i don't use webpack right now.
Luckily i found solution
moment.tz.zone('America/New_York').countries()
This will get you array so you guys can easily pass that value to locale()

@marwahaha
Copy link
Member

Glad you have found a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants