country-by-timezone
v2.0.0
Published
Get country data by timezone string
Downloads
15
Maintainers
Readme
country-by-timezone
Get country data by timezone string.
Timezone data used here is from IANA Database.
Install
npm i country-by-timezone
Usage
import getCountryByTimezone from "country-by-timezone";
const country = getCountryByTimezone("Asia/Kolkata");
console.log(country);
/*
{
countryCode: 'IN',
countryName: 'India',
timeZone: 'Asia/Kolkata',
coordinates: [ '20.0000', '77.0000' ]
}
*/
API
getCountryByTimezone(timezone)
Get country information by timezone string.
1. timezone
type:
string | string[]
A timezone string or string[] ex:Asia/Kolkata