Library / SDK
moment/moment-timezone avatar
moment/moment-timezone

moment-timezone: IANA zone support for a library that is in maintenance mode

Timezone support for moment.js

3,879 stars838 forksJavaScriptMIT

At a glance

What is it?
moment-timezone adds IANA time zone conversion to Moment.js. The README calls both projects legacy and in maintenance mode, so the decision is not whether it works but whether you want to depend on it.
Who is it for?
Adopt moment-timezone only if you already have Moment.js in the codebase and need IANA zone conversion without a wider rewrite; the package depends on moment ^2.29.4, so it is not a way to avoid that dependency. Do not adopt it for new projects that have no Moment code, because the README itself says both projects are legacy and in maintenance mode and that in most cases you should choose a different library.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 15 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What moment-timezone adds to Moment.js

Moment.js parses and formats dates, but on its own it does not resolve IANA zone identifiers such as America/Los_Angeles or Asia/Tokyo. moment-timezone is the add-on that supplies that mapping, including the historical offset changes that make a June date and a December date in the same zone print different abbreviations. The README example shows exactly this: a moment built from "2014-06-01T12:00:00Z" formats as 5am PDT in America/Los_Angeles, while a moment built from "2014-12-01T12:00:00Z" formats as 4am PST in the same zone. The audience is therefore narrow and specific. It is for teams that already ship Moment.js and need zone-aware conversion, display, or parsing in the same object model, rather than for anyone starting a date-handling layer from scratch. The README states the project's own position plainly: moment-timezone is an add-on for Moment.js, both are considered legacy projects now in maintenance mode, and in most cases you should choose a different library. That sentence should be the first thing you weigh, before any feature question.

How zone lookup and the packaged data work

The repository layout tells you most of the architecture. moment-timezone.js holds the add-on logic, index.js is the package entry point declared as "main" in package.json, and data/ holds the zone data that the add-on consumes. The builds/ directory holds prebuilt artifacts, and the jspm section of package.json points at builds/moment-timezone-with-data, which is the variant that carries zone data inside the bundle rather than expecting it to be loaded separately. The distinction between the plain build and the with-data build is the main integration decision, because a bundle without data cannot resolve a zone name. The package declares a single runtime dependency, moment ^2.29.4, so moment-timezone is not a replacement for Moment.js; it extends it. TypeScript consumers get declarations from index.d.ts, moment-timezone.d.ts and moment-timezone-utils.d.ts, with typing-tests/ present in the repository to exercise those definitions. There is also a separate moment-timezone-utils.js entry, which the top-level file list shows alongside its own declaration file, for working with zone data itself rather than with individual moments.

Installing moment-timezone and converting a real timestamp

The package is published to npm under the name moment-timezone, and the README links to its npm page. Installing it pulls moment as a dependency, so you do not install Moment.js separately unless you want to pin it yourself.

bash
npm install moment-timezone

After install, the entry point is index.js, which means a plain require resolves the add-on. The README's own example is the shortest path to a first real use: build a moment from a UTC string, then call tz() with an IANA identifier and format it.

js
var moment = require('moment-timezone');

var june = moment("2014-06-01T12:00:00Z");
june.tz('America/Los_Angeles').format('ha z'); // 5am PDT
june.tz('America/New_York').format('ha z');    // 8am EDT
june.tz('Asia/Tokyo').format('ha z');          // 9pm JST

What you should see is the offset and abbreviation for the same instant expressed in each zone, which is the behaviour the README documents. If you are loading the package in a browser or through a module loader rather than Node, the jspm configuration in package.json names builds/moment-timezone-with-data as the main artifact, which is the variant that carries zone data. Choosing the wrong artifact is the most common way to end up with a moment that cannot resolve a zone name at all.

Where moment-timezone is the wrong tool

The clearest limitation is stated by the project itself. The README describes moment-timezone and Moment.js as legacy projects in maintenance mode and says that in most cases you should choose a different library. That is not a hedge from an outside reviewer; it is the maintainers' own recommendation, and it should carry more weight than any feature comparison. A second constraint is structural: because the runtime dependency is moment ^2.29.4, adopting moment-timezone does not reduce your dependency surface, it adds to it. If your goal is to remove Moment.js from a bundle, moment-timezone moves you in the opposite direction. A third constraint is data. Zone rules change when governments change offsets, and the repository carries the data under data/ with prebuilt artifacts under builds/. That means the accuracy of your conversions is tied to which data version you ship, and the README does not document a rollback procedure for a bad data update. If your application needs sub-second precision, unusual calendar systems, or a modern immutable API, this is the wrong layer, and the README's own pointer to the Moment project status page is the honest starting point for that decision.

Alternatives and how their approach differs

The realistic alternatives differ in where the zone data lives and what the API returns. A modern date library that bundles IANA data and exposes immutable objects avoids the moment ^2.29.4 dependency entirely, which is the difference that matters if your reason for looking at moment-timezone is legacy cleanup. A lighter formatting library that relies on the platform's Intl time zone support takes a different route again: instead of shipping a data table, it delegates zone resolution to the JavaScript runtime, which changes your support matrix and your bundle size in the opposite direction. The trade-off is not that one approach is correct. moment-timezone carries its own data, so behaviour is consistent across runtimes and you can pin the data version. Delegating to Intl means less to ship but ties correctness to the host environment. If you are comparing against another Moment-based option, note that moment-timezone is an add-on rather than a fork: any alternative that also builds on Moment.js inherits the same maintenance-mode position described in the README.

Maintenance status, releases and the MIT licence

The repository is not archived, and the last push recorded on the default branch was on 2026-09-15. Releases have continued on a modest cadence: 0.6.2 on 2026-04-26, 0.6.3 on 2026-07-19, and 0.6.4 on 2026-09-15. Those dates show the project is still receiving updates, but the README's own description of both Moment.js and moment-timezone as legacy projects in maintenance mode is the better guide to what those updates mean. Maintenance mode implies fixes and data refreshes rather than new capability, and the README makes no commitment about the release schedule. For upgrade cost, the practical work sits in the zone data and the build artifact you consume: a version bump can change the data set, so the thing to test after upgrading is the zone identifiers and offsets your application actually depends on, not the API surface. The licence is MIT, declared in package.json and in the README's license section. MIT is permissive, so redistribution and modification are broadly allowed, but the repository also carries a FOSSA status badge, which suggests dependency licence scanning is part of the project's own process. This is a description of what the repository states, not legal advice; route licence questions through your own review.

Editorial conclusion

Adopt moment-timezone only if you already have Moment.js in the codebase and need IANA zone conversion without a wider rewrite; the package depends on moment ^2.29.4, so it is not a way to avoid that dependency. Do not adopt it for new projects that have no Moment code, because the README itself says both projects are legacy and in maintenance mode and that in most cases you should choose a different library. Before committing, verify the zone data your build actually ships: check which builds/ artifact you load or which data/ version you pack, and confirm the zone identifiers you pass to tz() exist in that data set.

Frequently asked questions

Is moment-timezone deprecated?

The README does not use the word deprecated, but it states that moment-timezone and Moment.js are both considered legacy projects now in maintenance mode, and that in most cases you should choose a different library. The repository is not archived and the last push was on 2026-09-15, so it is still receiving updates.

How do I install moment-timezone?

It is published to npm as moment-timezone, so it installs with npm install moment-timezone. package.json declares a runtime dependency on moment ^2.29.4, so Moment.js comes along with it.

How do I use moment-timezone?

The README example builds a moment from a UTC string, calls tz() with an IANA identifier such as America/Los_Angeles, and then formats the result. The same instant produces different offsets and abbreviations for each zone you name.

What is the difference between moment and moment-timezone?

moment-timezone is an add-on for Moment.js rather than a separate date library. package.json lists moment ^2.29.4 as its only runtime dependency, and the add-on supplies the IANA zone support that Moment.js does not resolve on its own.

What is moment-timezone?

The README describes it as IANA time zone support for Moment.js, and package.json describes the package as parsing and displaying moments in any timezone. It ships zone data in the repository under data/, with prebuilt artifacts in builds/.

What should I replace moment.js with?

The README does not name a specific replacement. It says both Moment.js and moment-timezone are legacy projects in maintenance mode and points readers to the Project Status page in the Moment docs for details and recommendations.

Official sources

  1. Issues
  2. License: MIT
  3. moment/moment-timezone on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/moment-moment-timezone.svg)](https://hysenlabs.com/projects/moment-moment-timezone)