country-by-timezone
Get country by it's timezone.
Highlights
- Dynamic JSON loading to reduce initial page load when used in webapps.
- Simple and easy to use API.
- The timezone data for the lib comes from IANA timezones database.
- Fully supports ESM.
Installation
yarn add country-by-timezone
Usage/Examples
import getCountryByTimezone from "country-by-timezone";
getCountryByTimezone("Asia/Kolkata");
/*
Prints:
{
countryCode: 'IN',
countryName: 'India',
timeZone: 'Asia/Kolkata',
coordinates: [ '20.0000', '77.0000' ]
}
*/
API Reference
getCountryByTimezone(input)
Get a country by timezone.
input
type: string | string[]
desc: A timezone string or string[] ex: Asia/Kolkata
Support
You can support my work right here:
License
Rocktim Saikia © 2021 MIT