npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

iata-tz

v1.0.3

Published

A robust Node.js module for converting times between airport timezones using IATA codes. Features include UTC to local time conversion, local to UTC conversion, timezone offset calculations, and direct conversions between different airport timezones. Buil

Readme

iata-tz

✈️ Overview

iata-tz is a robust Node.js module for converting times between airport timezones using IATA codes. It provides accurate conversions between UTC and local airport times, handles daylight saving time (DST) automatically, and supports all major airports worldwide.

🚀 Installation

npm install iata-tz

🔥 Features

  • ✅ Convert local airport time to UTC
  • ✅ Convert UTC to local airport time
  • ✅ Convert times between different airport timezones
  • ✅ Get timezone offset information for airports
  • ✅ Automatic handling of Daylight Saving Time (DST)
  • ✅ Supports all major airports worldwide

🛠️ Usage

const { convertToUTC, convertFromUTC, convertBetweenTimezones, getTimezoneOffset } = require('iata-tz');

// Convert local time to UTC
const utcTime = convertToUTC('JFK', '2024-01-29 14:30:00');
console.log(utcTime); // '2024-01-29 19:30:00'

// Convert UTC to local time
const localTime = convertFromUTC('LAX', '2024-01-29 19:30:00');
console.log(localTime); // '2024-01-29 11:30:00'

// Convert time between two airports
const convertedTime = convertBetweenTimezones(
  'JFK',  // source airport
  'LAX',  // target airport
  '2024-01-29 14:30:00'  // time in JFK
);
console.log(convertedTime); // '2024-01-29 11:30:00'

// Get timezone information
const tzInfo = getTimezoneOffset('JFK');
console.log(tzInfo);
// Output:
// {
//   offsetHours: -5,
//   timezone: 'America/New_York',
//   isDST: false
// }

📖 API Reference

convertToUTC(iataCode, localTime)

Converts local time at an airport to UTC.

  • iataCode (string): IATA airport code (e.g., 'JFK', 'LAX')
  • localTime (string): Local time in 'YYYY-MM-DD HH:mm:ss' format
  • Returns: UTC time string in 'YYYY-MM-DD HH:mm:ss' format

convertFromUTC(iataCode, utcTime)

Converts UTC time to local time at an airport.

  • iataCode (string): IATA airport code
  • utcTime (string): UTC time in 'YYYY-MM-DD HH:mm:ss' format
  • Returns: Local time string in 'YYYY-MM-DD HH:mm:ss' format

convertBetweenTimezones(sourceIATA, targetIATA, sourceTime)

Converts time between two airport timezones.

  • sourceIATA (string): Source airport IATA code
  • targetIATA (string): Target airport IATA code
  • sourceTime (string): Source time in 'YYYY-MM-DD HH:mm:ss' format
  • Returns: Target time string in 'YYYY-MM-DD HH:mm:ss' format

getTimezoneOffset(iataCode, [date])

Gets timezone information for an airport.

  • iataCode (string): IATA airport code
  • date (Date, optional): Date to check offset for (defaults to current date)
  • Returns: Object containing offset information:
    • offsetHours (number): Offset from UTC in hours
    • timezone (string): Timezone name
    • isDST (boolean): Whether DST is in effect

⚠️ Error Handling

All functions will throw an Error if:

  • ❌ An invalid IATA code is provided
  • ❌ An invalid time format is used
  • ❌ An invalid timezone conversion is attempted

📦 Dependencies

  • moment-timezone for reliable timezone calculations

📜 License

MIT

🛠️ Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request