@mikazuki/tz-convert
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    tz-convert

    GitHub CircleCI npm (scoped)

    Convert timezones between Microsoft Timezone Index Values and IANA Time Zone.

    Install

    yarn add @mikazuki/tz-convert
    

    CDN : UNPKG | jsDelivr

    How to use

    In Browser

    <script src="https://cdn.jsdelivr.net/npm/@mikazuki/tz-convert"></script>
    <script>
      console.log(window.TzConvert.ianaToWindows("Asia/Tokyo")); // => Tokyo Standard Time
      console.log(window.TzConvert.windowsToIana("Tokyo Standard Time")); // => Asia/Tokyo
    </script>

    In Node.js

    import { ianaToWindows, windowsToIana } from "@mikazuki/tz-convert";
    
    ianaToWindows("Asia/Tokyo"); // => Tokyo Standard Time
    windowsToIana("Tokyo Standard Time"); // => Asia/Tokyo

    If you want to see real-world example?
    Please check-out Knockru/Crouton repository!

    Notes

    This library is used Unicode CLDR as first data source.

    Keywords

    none

    Install

    npm i @mikazuki/tz-convert

    DownloadsWeekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    174 kB

    Total Files

    9

    Last publish

    Collaborators

    • mikazuki