Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

windows-iana

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

windows-iana

A small tool to convert between Windows time zones and IANA

  • 5.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

This library exports two functions to help convert from Windows time zones to IANA time zones (based on this mapping definition and this list of IANA aliases).

Installation

Add the dependency to your project with npm install --save windows-iana or yarn add windows-iana.

Compatibility

The library should work on Node.js >= 12 and all modern broswers. However, it does use [].flat(), which is not supported on IE and would require a polyfill.

Usage

The library exports:

  • findIana(): returns an array of possible IANA time zones (including all their aliases) for a given Windows zone.
  • findWindows(): returns an array of possible Windows time zones for a given IANA zone and all its aliases.
  • findIanaAliases(): returns an array of IANA aliases for a given IANA zone name, including the one passed as a parameter.
  • IANA_ALIAS_MAP: the IANA alias map used by the library.
  • WINDOWS_TO_IANA_MAP: the Windows to IANA map used by the library.

findIana()

import { findIana } from 'windows-iana';

const result = findIana('Romance Standard Time');
console.log(result); // ['Europe/Paris', 'Europe/Brussels', 'Europe/Copenhagen', 'Europe/Madrid', 'Africa/Ceuta']

findWindows()

import { findWindows } from 'windows-iana';

const result = findWindows('America/New_York');
console.log(result); // ['Eastern Standard Time']

findIanaAliases()

import { findIanaAliases } from 'windows-iana';

const result = findIanaAliases('Asia/Ho_Chi_Minh');
console.log(result); // ['Asia/Saigon', 'Asia/Ho_Chi_Minh']

Keywords

FAQs

Package last updated on 20 Oct 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc