IANA TZ Database for Europe

1.0.48 · active · verified Wed Apr 22

The `tzdata-europe` package provides a specific subset of the IANA Time Zone Database, specifically the data found in the 'europe' file, formatted as a JavaScript object that can be directly consumed as JSON. Its current stable version is `1.0.48`, which encapsulates the IANA TZ Database version `2026a`. The package maintains a frequent release cadence, typically updating multiple times per year to align with the latest IANA TZ database releases (e.g., `202Xb`, `202Xc`). This module is not a standalone time zone manipulation library but rather a data provider, intended to be consumed by other libraries like `timezonecomplete` for actual time zone operations. Its key differentiator is providing only the European zones, allowing for smaller bundle sizes in applications that don't need the full global dataset.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to load the European time zone data using CommonJS in Node.js, access specific zone information, and perform basic data exploration.

const europeTimezones = require('tzdata-europe');

// The entire European time zone database is loaded as a JavaScript object.
// Each key is an IANA time zone identifier (e.g., 'Europe/London').
// The value is an object containing details like name, transitions, and rules.

// Access a specific time zone entry, for example, 'Europe/Paris'
const parisData = europeTimezones['Europe/Paris'];

if (parisData) {
  console.log('Successfully loaded data for Europe/Paris:');
  console.log(`Zone Name: ${parisData.name}`);
  console.log(`Number of transitions: ${parisData.transitions.length}`);
} else {
  console.log('Europe/Paris data not found (this should not happen for valid zones).');
}

// You can iterate over all available zones in this package:
console.log('\nTotal number of European zones in this package:', Object.keys(europeTimezones).length);

// Example: Find a zone that uses a specific base offset (e.g., UTC+1)
const zonesAtUTCPlusOne = Object.keys(europeTimezones).filter(zoneId => {
  const zone = europeTimezones[zoneId];
  // This is a simplified check; actual offset calculation needs a full TZ library
  // For demonstration, let's just check if it has a common 'offset' property for simplicity.
  // (Note: The actual data structure is more complex and involves 'transitions'.)
  return zone.transitions && zone.transitions[0] && zone.transitions[0].offset === 3600; // Example: 3600 seconds for UTC+1
});
console.log('\nZones that potentially start at UTC+1 (simplified check):', zonesAtUTCPlusOne.slice(0, 5).join(', ') + (zonesAtUTCPlusOne.length > 5 ? '...' : ''));

view raw JSON →