country-data-list
Version:
Data about countries - like their ISO codes and currencies
43 lines • 1.66 kB
TypeScript
/**
* Get timezones for a specific country by alpha2 code
* @param {string} countryCode - The alpha2 country code
* @returns {string[]|null} - Array of timezone strings for that country or null if not found
*/
export function getTimezonesByCountry(countryCode: string): string[] | null;
/**
* Get all countries that use a specific timezone
* @param {string} timezone - The timezone to look for (e.g. "Europe/London")
* @returns {string[]} - Array of country codes that use this timezone
*/
export function getCountriesForTimezone(timezone: string): string[];
/**
* Get current UTC offset for a timezone
* Europe/London (winter) → +00:00
* Europe/London (summer) → +01:00
*
* Asia/Kolkata → +05:30
*
* Invalid timezone → null
* Use timeZoneName: 'shortOffset' (supported in modern browsers and Node)
* @param {string} timezone - Timezone string (e.g. "Europe/London")
* @returns {string} - UTC offset in format "+HH:MM" or "-HH:MM"
*/
export function getUtcOffsetV2(timezone: string): string;
/**
* Get current UTC offset for a timezone
* @param {string} timezone - Timezone string (e.g. "Europe/London")
* @returns {string} - UTC offset in format "+HH:MM" or "-HH:MM"
*/
export function getUtcOffset(timezone: string): string;
export default timezoneData;
export const allTimezones: string[];
export namespace timezones {
export { allTimezones as all };
export { timezoneData as byCountry };
export { getTimezonesByCountry };
export { getCountriesForTimezone };
export { getUtcOffset };
export { getUtcOffsetV2 };
}
import timezoneData from './timezones.js';
//# sourceMappingURL=timezones.module.d.ts.map