netzila-timezone
v0.0.2
Published
A simple JavaScript/TypeScript library providing a list of time zones.
Downloads
3
Readme
netzila-timezone
A simple JavaScript/TypeScript library providing a list of time zones.
Installation
You can install the package using npm:
npm install netzila-timezone
Usage
JavaScript (CommonJS)
const { timeZone } = require('netzila-timezone');
// Use timeZone function
console.log(timeZone());
TypeScript / ES6 Modules
import { timeZone } from 'netzila-timezone';
// Use timeZone function
console.log(timeZone());
API
timeZone(): TimeZoneItem[]
Returns an array of time zone objects, each containing value and name properties.
value
: The time zone identifier.name
: The display name of the time zone.
Example:
const timeZones = timeZone();
console.log(timeZones);
/*
[
{ value: 'Africa/Abidjan', name: 'Africa/Abidjan' },
{ value: 'Africa/Accra', name: 'Africa/Accra' },
// ... other time zones
]
*/