Registry / serialization / tzdata-europe

tzdata-europe

JSON →
library1.0.48jsnpmunverified

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.

npm install tzdata-europe
INSTALL
IMPORT
SIG · TZDATA-EUROPE
T
tzdata-europe
serializationjavascriptv1.0.48
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Time Zone Data (CommonJS)
const europeTimezones = require('tzdata-europe');
The package exports the raw JSON data directly as its default CommonJS export for Node.js and CommonJS-compatible environments.
Time Zone Data (ESM)
import europeTimezones from 'tzdata-europe';
import { europeTimezones } from 'tzdata-europe';
Although primarily a CommonJS module, Node.js's interoperability allows for default ESM imports. The data object is the default export, not a named export.
tzdataEurope Global (Browser)
<script src="./node_modules/tzdata-europe/tzdata-europe.js"></script> <script> const europeTimezones = tzdataEurope; </script>
import tzdataEurope from 'tzdata-europe'
When used directly in a browser via a script tag, the UMD build exposes the data as a global variable `tzdataEurope`. It does not support standard browser module imports.

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 ? '...' : ''));
Debug
Known issues
gotchaThe data provided by this package is a snapshot of the IANA TZ database at a specific point in time. Time zone rules can change frequently due to political or geographical reasons. Always ensure you are using a recent version of the package to have the most up-to-date data for accurate time calculations.
fix
Regularly update the 'tzdata-europe' package to its latest version (e.g., 'npm install tzdata-europe@latest' or 'yarn upgrade tzdata-europe').
affects: all
breakingVersion 1.0.45 introduced a change by removing a 'null' timezone entry. If previous application logic relied on the presence or specific structure of such an entry, this update might cause unexpected behavior related to missing keys or altered data structures when iterating over all zones.
fix
Review code that accesses or iterates over all time zone entries, particularly if it handles edge cases or unexpected zone names. Ensure robustness against missing or removed entries, and adapt to the updated data structure if necessary.
affects: >=1.0.45
breakingThis package contains *only* the data for time zones geographically defined within Europe by the IANA database. Attempting to access non-European time zones (e.g., 'America/New_York' or 'Asia/Tokyo') from this specific package will result in 'undefined' or a missing key, leading to errors if not properly handled.
fix
For global time zone support, consider using the main 'tzdata' package or combine multiple regional 'tzdata-*' packages. Always validate the existence of a time zone key (e.g., `if (europeTimezones[zoneId])`) before attempting to use its associated data.
affects: all
Errors
Common errors & fixes
Cannot find module 'tzdata-europe'
The package is not installed or the Node.js runtime cannot resolve the module path for CommonJS imports.
fix
Run 'npm install tzdata-europe' or 'yarn add tzdata-europe' in your project directory. Ensure your Node.js application is executed in a context where the module is resolvable, typically within the project's root or a subdirectory.
europeTimezones is not defined (in browser console)
The UMD script for 'tzdata-europe' was not loaded into the browser's global scope, or it was loaded after the script attempting to use `tzdataEurope`, or the global variable name is misspelled.
fix
Ensure the `<script src="./node_modules/tzdata-europe/tzdata-europe.js"></script>` tag is present in your HTML `<head>` or before any JavaScript code that tries to access `tzdataEurope`. Verify the global variable name is correctly spelled as `tzdataEurope`.
TypeError: Cannot read properties of undefined (reading 'transitions')
You attempted to access properties (like 'transitions') of a time zone that does not exist or was incorrectly referenced within the `europeTimezones` object. This typically occurs when requesting a non-European zone or a misspelled zone identifier.
fix
Double-check the time zone identifier string (e.g., 'Europe/Berlin') for correctness and ensure it is listed among the zones provided by `tzdata-europe`. If you need global time zone coverage, switch to the full 'tzdata' package.
Upgrade
Version history
1.0.48latest on npm
Audit
Dependencies
timezonecompleteoptionalRecommended for performing actual time zone operations using this data; this package only provides the raw data.
Agent activity
35 hits · last 30 days
node
32
OpenAI (training)
1
Resources
tzdata-europe — npm install tzdata-europe · libregistry