Miss any of our Open RFC calls?Watch the recordings here! »

uic-location-timezone

0.0.0 • Public • Published

uic-location-timezone

Get timezone information for a given UIC location code (ENEE) based on its country, if the country has a unique timezone.

npm version Build Status Greenkeeper badge dependency status license chat on gitter

Installation

npm install uic-location-timezone

Usage

Note that the given UIC location code must be deemed valid by is-uic-location-code, otherwise an Error will be thrown.

const uicLocationTimezone = require('is-uic-location-code')
 
uicLocationTimezone('1000010') // 'Europe/Helsinki'
uicLocationTimezone('7300003') // 'Europe/Athens'
uicLocationTimezone('8000001') // null (yes, Germany has two timezones… https://en.wikipedia.org/wiki/Time_in_Germany#IANA_time_zone_database)
uicLocationTimezone('4200012') // 'Asia/Tokyo'
uicLocationTimezone('9000100') // 'Africa/Cairo'
uicLocationTimezone('2000001') // null (Russia)
 
uicLocationTimezone('80-00001') // throws
uicLocationTimezone(8777777) // throws
uicLocationTimezone('800000001') // throws
uicLocationTimezone(null) // throws

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.

Install

npm i uic-location-timezone

DownloadsWeekly Downloads

1

Version

0.0.0

License

ISC

Unpacked Size

4.48 kB

Total Files

4

Last publish

Collaborators

  • avatar