2.0.0 • Published 12 months ago

country-by-timezone v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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