0.0.0 • Published 6 years ago
uic-location-timezone v0.0.0
uic-location-timezone
Get timezone information for a given UIC location code (ENEE) based on its country, if the country has a unique timezone.
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.
0.0.0
6 years ago