Gathering detailed insights and metrics for @vvo/tzdb
Gathering detailed insights and metrics for @vvo/tzdb
🕰 Simplified, grouped and always up to date list of time zones, with major cities
npm install @vvo/tzdb
Typescript
Module System
Node Version
NPM Version
99.6
Supply Chain
99.6
Quality
94.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
15,236,570
Last Day
29,189
Last Week
138,455
Last Month
584,116
Last Year
6,496,658
809 Stars
542 Commits
55 Forks
6 Watching
21 Branches
12 Contributors
Minified
Minified + Gzipped
Latest Version
6.159.0
Package Id
@vvo/tzdb@6.159.0
Unpacked Size
170.36 kB
Size
37.47 kB
File Count
20
NPM Version
10.8.2
Node Version
18.20.5
Publised On
17 Jan 2025
Cumulative downloads
Total Downloads
Last day
-12.1%
29,189
Compared to previous day
Last week
-12.7%
138,455
Compared to previous week
Last month
10.5%
584,116
Compared to previous month
Last year
46.4%
6,496,658
Compared to previous year
This is a list and npm package of:
Pacific Time
instead of America/Los_Angeles
, along with major cities for each time zone.The data and npm packages are automatically updated whenever there are changes to https://www.geonames.org/ which is generated from IANA databases.
This is useful whenever you want to build a time zone select menu in your application.
Installation:
1npm add @vvo/tzdb
Usage:
1import { getTimeZones, rawTimeZones, timeZonesNames, abbreviations } from "@vvo/tzdb";
1const timeZones = getTimeZones(); 2 3// You can also provide an optional parameter to include UTC in the result. 4// This adds a time zone with the name "UTC" and a fixed offset of 0. 5const timeZonesWithUtc = getTimeZones({ includeUtc: true });
This method returns an array of time zones objects:
1[ 2 // ... 3 { 4 name: "America/Los_Angeles", 5 alternativeName: "Pacific Time", 6 group: ["America/Los_Angeles"], 7 continentCode: "NA", 8 continentName: "North America", 9 countryName: "United States", 10 countryCode: "US", 11 mainCities: ["Los Angeles", "San Diego", "San Jose", "San Francisco"], 12 rawOffsetInMinutes: -480, 13 abbreviation: "PST", 14 rawFormat: "-08:00 Pacific Time - Los Angeles, San Diego, San Jose, San Francisco", 15 currentTimeOffsetInMinutes: -420, // "current" time zone offset, this is why getTimeZones() is a method and not just an object: it works at runtime 16 currentTimeFormat: "-07:00 Pacific Time - Los Angeles, San Diego", 17 }, 18 // ... 19];
When relevant, time zones are grouped. The rules for grouping are:
name
attribute), is always the one from the most populated cityHere's a grouping example:
1{ 2 name: "America/Dawson_Creek", 3 alternativeName: "Mountain Time", 4 group: ["America/Creston", "America/Dawson_Creek", "America/Fort_Nelson"], 5 continentCode: "NA", 6 continentName: "North America", 7 countryName: "Canada", 8 countryCode: "CA", 9 mainCities: ["Fort St. John", "Creston", "Fort Nelson"], 10 rawOffsetInMinutes: -420, 11 abbreviation: "MST", 12 rawFormat: "-07:00 Mountain Time - Fort St. John, Creston, Fort Nelson", 13 currentTimeOffsetInMinutes: -420, 14 currentTimeFormat: "-07:00 Mountain Time - Fort St. John, Creston" 15}
This is an array of time zone objects without the current time information:
1[ 2 // ... 3 { 4 name: "America/Los_Angeles", 5 alternativeName: "Pacific Time", 6 group: ["America/Los_Angeles"], 7 continentCode: "NA", 8 continentName: "North America", 9 countryName: "United States", 10 countryCode: "US", 11 mainCities: ["Los Angeles", "San Diego", "San Jose", "San Francisco"], 12 rawOffsetInMinutes: -480, 13 abbreviation: "PST", 14 rawFormat: "-08:00 Pacific Time - Los Angeles, San Diego, San Jose, San Francisco", 15 }, 16 // ... 17];
This is an array of time zone names:
1[ 2 // ... 3 "America/Juneau", 4 "America/Kentucky/Louisville", 5 "America/Kentucky/Monticello", 6 "America/Kralendijk", 7 "America/La_Paz", 8 "America/Lima", 9 "America/Los_Angeles", 10 "America/Lower_Princes", 11 "America/Maceio", 12 "America/Managua", 13 "America/Manaus", 14 "America/Marigot", 15 "America/Martinique", 16 "America/Matamoros", 17 // ... 18];
This is an object mapping timezone abbreviations to their full forms:
1{ 2 // ... 3 "Australian Central Daylight Time": "ACDT", 4 "Australian Central Standard Time": "ACST", 5 "Australian Central Time": "ACT", 6 "Australian Central Western Standard Time": "ACWST", 7 "Australian Eastern Daylight Time": "AEDT", 8 "Australian Eastern Standard Time": "AEST", 9 "Australian Eastern Time": "AET", 10 "Australian Western Daylight Time": "AWDT", 11 "Australian Western Standard Time": "AWST", 12 "Azerbaijan Summer Time": "AZST", 13 "Azerbaijan Time": "AZT", 14 "Azores Summer Time": "AZOST", 15 "Azores Time": "AZOT", 16 "Bangladesh Standard Time": "BST", 17 "Bhutan Time": "BTT", 18 "Bolivia Time": "BOT", 19 // ... 20};
Caution: Although abbreviations can be easy to lookup, they can be misleading. For example: CST can refer to Central Standard Time (-06.00 UTC), China Standard Time (+06.00 UTC) or Cuba Standard Time (-05.00 UTC). And abbreviation full forms don't directly map to any property in the time zone objects returned by rawTimeZones
or getTimeZones()
.
name
attribute (America/Los_Angeles
) in your database1const value = timeZones.find((timeZone) => { 2 return dbData.timeZone === timeZone.name || timeZone.group.includes(dbData.timeZone); 3});
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
39 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More