Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More
Socket
Book a DemoSign in
Socket

utc-to-timezone

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utc-to-timezone

Converts the given UTC time to the given timezone

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

utc-to-timezone

This npm package converts the given UTC date and time to the specified timezone.

📌 Installation:

npm i utc-to-timezone

📥 Input:

The input can be,

  • String - '2025-11-26T12:00:00.000Z' or
  • new Date('2025-11-26T12:00:00.000Z')

🧩 Usage:

Example 1:

const timezoneConvert = require('utc-to-timezone');
console.log(timezoneConvert.utcToTimeZone('2025-11-26T12:00:00.000Z', 'Asia/Kolkata', 'en-IN', true));

🧑‍💻 Output:

2025-11-26T17:30:00.000Z

Example 2:

const { utcToTimeZone} = require('utc-to-timezone');
console.log(utcToTimeZone('2025-11-26T12:00:00.000Z', 'Asia/Kolkata', 'en-IN', true));

🧑‍💻 Output:

2025-11-26T17:30:00.000Z

Example 3:

const { utcToTimeZone} = require('utc-to-timezone');
console.log(utcToTimeZone('2025-11-26T12:00:00.000Z', 'Asia/Kolkata', 'en-IN', false));

🧑‍💻 Output:

26/11/2025, 17:30:00 (This format is based on locale)

🛠 Parameters:

Param 1: UTC date either in string or Date format.

Param 2: Target timezone (default is 'Asia/Kolkata')

Param 3: Locale for formatting (default is 'en-CA')

Param 4: Boolean to determine if output should be in ISO format (default is false)

FAQs

Package last updated on 26 Nov 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