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

timezone-convert

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezone-convert

Convert between timezone formats

latest
Source
npmnpm
Version
1.3.6
Version published
Maintainers
1
Created
Source

timezone-convert

Convert between timezone formats

Project's branding image

timezone-convert TypeScript heart icon

npm version npm downloads Codecov Bundlejs

Overview

timezone-convert is a small and efficient utility library and CLI for (smart parsing and) converting between timezone formats.

Important notes

Imperfect accuracy

The primary goal of the project is to focus on converting from one timezone format into a roughly accurate representation in other formats for possible of use with other libraries (e.g Windows display name from calendar => TZID / IANA for datetime manipulation), and AS SIMPLE AS POSSIBLE, things like extensive array mapping (Windows id => Multiple IANA ids) won't be available.

Partial 'etcetera' and 'backward' zones for IANA

The project will only supports the ETC IANA ids that is also used by Windows, and only supports the commonly-used backward IANA ids (like America/Indianapolis), uncommon ids like WET, W-SU is not supported, but in a fast-check, this library should support a few more commonly-used ids than windows-iana.

Features

  • Parsing and converting between:
    • Windows display name
    • Windows time zone id
    • IANA (Olsen) tzdb ids
  • Auto parse from any formats, just parseTzAuto(str)

Usage

CLI

npx timezone-convert "Europe/Athens"
# Outputs a JSON string of the parsed timezone
# { iana, windowsId, windowsDisplay }

# Example use with `jq`
npx -y timezone-convert Asia/Saigon | jq '.windowsDisplay'

Programatic

Install package

# npm
npm install timezone-convert

# bun
bun add timezone-convert

# pnpm (recommended)
pnpm install timezone-convert

Import & use:

// ESM
import { parseTzAuto } from 'timezone-convert'

const bucharestTz = parseTzAuto('Europe/Bucharest')

License

License

Keywords

cli

FAQs

Package last updated on 03 Jul 2025

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