/country-by-timezone

Get country data by timezone string.

Primary LanguageJavaScriptMIT LicenseMIT

country-by-timezone

Get country data by timezone string.

Timezone data used here is from IANA Database.

CI npm

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