timezone-names
A simple library to get timezone offsets. Functions accept timezone names. Abbreviations are not supported because same abbreviation is used for multiple timezones.
Functions
getTimezoneByName
Get timezone info object.
var tz = ;tz;// ReturnsAbbreviation: 'PST' //Abbreviation for the timezoneName: 'Pacific Standard Time' //Standard NameDisplayName: 'Pacific Standard Time(UTC - 8)' //Display StringOffset: '-8 hours' //Offset string
getTimezoneOffsetByName
Get timezone offset.
tz;// ReturnsOffset: '-8 hours' //Offset StringHours: -8 //Hours componentMinutes: 0 //Minutes ComponentTotalMinutesOffset: -480 //Total Offset in Minutes
getAll
Get all timezones objects.
tz;// Returns Array of timezone objectsAbbreviation: 'PST' //Abbreviation for the timezoneName: 'Pacific Standard Time' //Standard NameDisplayName: 'Pacific Standard Time(UTC - 8)' //Display StringOffset: '-8 hours' //Offset string