Skip to the content.

timezones

Every JavaScript time zone, plus a random one.

npm npm downloads CI codecov

Based on this StackOverflow Question

Usage

ESM only, types included: the same import works in Node.js, Bun and browsers.

import {
  randomTimeZone,
  timeZones,
} from "@ultirequiem/timezones";

console.log(`My timezone is ${randomTimeZone()}.`);

const date = new Date();

for (const timeZone of timeZones) {
  console.log(timeZone, date.toLocaleString("en-US", { timeZone }));
}

Documentation

For more examples checkout Timero and the CLI Tool.

Support

Open an Issue, I will check it as soon as possible πŸ‘€

If you want to hurry me up a bit send me a tweet πŸ˜†

Don’t forget to star the repo ⭐

Notes

This was done mainly because Timero.

Authors

Eliaz Bobadilla - Creator and Maintainer πŸ’ͺ

See also the full list of contributors who participated in this project ✨

Versioning

We use Semantic Versioning. For the versions available, see the tags 🏷️

Licence

Licensed under the MIT License πŸ“„