@litert/timezone
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

LiteRT/TimeZone

npm version License GitHub issues GitHub Releases

The timezone support library of LiteRT.

Copyright: This is just a toolset of timezone operation for JavaScript. As all timezone data is extracted from WikiPedia.

Requirements

  • TypeScript v3.1.x (Or newer)

Installation

npm i @litert/timezone --save

Usage

import TZ from "@litert/timezone";

console.log(TZ.findByName("Asia/Brunei")); // Find the info of timezone Asia/Brunei.

console.log(TZ.findByLocation("US")); // Find the list of timezone used by US.

console.log(TZ.findByOffset(480)); // Find the list of timezones whose offset is 480 (from UTC, ini).

console.log(TZ.findByDSTOffset(480)); // Find the list of timezones whose DST offset is 480.

console.log(TZ.findCanonicalList()); // Find out list of all canonical timezone.

console.log(TZ.offsetToString(480)); // Convert minute offset into string, which should be +08:00.

console.log(TZ.offsetFromString('-08:00')); // Convert a string into minute offset, which should be -480.

Documents

Preparing yet.

License

This library is published under Apache-2.0 license.

Package Sidebar

Install

npm i @litert/timezone

Weekly Downloads

0

Version

0.1.3

License

Apache-2.0

Unpacked Size

456 kB

Total Files

10

Last publish

Collaborators

  • fenying