New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

isdcode-country-timezone

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isdcode-country-timezone

NPM package to get the timezone from ISD/Dial code

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

Usage

 const timezone = require('isdcode-country-timezone');

getCountries()

This function will return the array of all the countries with ISD/dial code and Time zone.

Output

[
    {
       "dialcode" :  "+263",
        "country": "Zimbabwe",
       "timezone" :  "+2"
    },
    {
        "dialcode" : "+91",
        "country": "India",
        "timezone" :"+5.5"
    },
  ...
]

getTimezone(<dial_code>)

This function will return the timezone of the given ISD / dial code.

Example

To get the list of all the states of INDIA, the function call will look like:

let timezone = getTimezone('+91');

console.log(timezone)

Output

'India'

Keywords

country

FAQs

Package last updated on 18 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts