0

How do I determine the timezone (in javascript) if Country-Code, State and City is known ? For example: Country:US State CA is know

Pradeep Mahato
  • 41
  • 2
  • 11

1 Answers1

0

There are a few libraries that include this information within them, one of this is https://www.npmjs.com/package/countryjs. Using their .info() you get the information of that zone, including timezone.

However, as mentioned in duplicates, this is hard since some states span multiple timezones.

Check this other duplicate, there are good answers there: What is the best way of getting the timezone from the city, country that user selects?

As mentioned, jsTimezoneDetect is a good resource.

Hope that helps.

Community
  • 1
  • 1
Obed Parlapiano
  • 3,226
  • 3
  • 21
  • 39