1.0.0 • Published 3 years ago

country-by-timezone v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

country-by-timezone

Build Status NPM Version GitHub

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

You can support my work right here:

Rocktim Saikia © 2021 MIT