Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

timezone-package-ts

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezone-package-ts

A TypeScript package for handling timezone data, including functionalities to get timezone information by country code(s), group timezones by country code, and more.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
0
Created
Source

Timezone Package TS

A TypeScript package for handling timezone data, including functionalities to get timezone information by country code(s), group timezones by country code, and more.

Installation

You can install this package via npm or yarn:

npm install timezone-package-ts

yarn add timezone-package-ts

Importing the Package To use the functions provided by the package, first import them:

import { getTimezoneByCountry, getTimezoneGroupByCountryCode, getTimezoneList, getUTC } from 'timezone-package-ts';

Functions

  • getTimezoneByCountry(cn: string | string[]): FormattedResponse[] Fetches timezone information based on a single country code or an array of country codes.

const timezones = getTimezoneByCountry('US'); console.log(timezones);

  • getTimezoneGroupByCountryCode(): { [key: string]: CountryTimezoneGroup } Groups timezones by country code.

const groupedTimezones = getTimezoneGroupByCountryCode(); console.log(groupedTimezones);

  • getTimezoneList(): FormattedResponse[] Returns a list of all available timezones.

const timezoneList = getTimezoneList(); console.log(timezoneList);

  • getUTC(): FormattedResponse Returns the UTC timezone information.

const utcInfo = getUTC(); console.log(utcInfo);

Author Monu Choudhary - monuchoudhary660@gmail.com

FAQs

Package last updated on 29 Aug 2024

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