All Projects → infused → ziptz

infused / ziptz

Licence: MIT license
Get the time zone and daylight saving time support for any US ZIP code

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to ziptz

tz.js
A library for working with timezones in JavaScript. Used as part of https://github.com/dbaron/timezone-map .
Stars: ✭ 25 (-60.94%)
Mutual labels:  timezones
graphcountries
An easy to use GraphQL API to query country-related data for free and without restrictions
Stars: ✭ 61 (-4.69%)
Mutual labels:  timezones
world
A Laravel package which provides a list of the countries, states, cities, currencies, timezones and languages.
Stars: ✭ 479 (+648.44%)
Mutual labels:  timezones
postal-codes-json-xml-csv
Collection of postal codes in different formats, ready for importing.
Stars: ✭ 181 (+182.81%)
Mutual labels:  zipcodes
scala-java-time
Implementation of the `java.time` API in scala. Especially useful for scala.js
Stars: ✭ 111 (+73.44%)
Mutual labels:  timezones
Friend-Time
Discord bot - Friend Time helps your server coordinate times and events by converting times mentioned in chat between time zones!
Stars: ✭ 62 (-3.12%)
Mutual labels:  timezones
Zip-code-of-all-countries-cities-in-the-world-CSV-TXT-SQL-DATABASE
Zip code of all countries in the world along with cities in CSV, TXT, SQL DATABASE
Stars: ✭ 35 (-45.31%)
Mutual labels:  zipcodes
hawking
A Natural Language Date Time Parser that Extract date and time from text with context and parse to the required format
Stars: ✭ 168 (+162.5%)
Mutual labels:  timezones
Zipcodes
A simple library for querying U.S. zipcodes.
Stars: ✭ 63 (-1.56%)
Mutual labels:  zipcodes
Luxon
⏱ A library for working with dates and times in JS
Stars: ✭ 11,926 (+18534.38%)
Mutual labels:  timezones
Dateutil
Useful extensions to the standard Python datetime features
Stars: ✭ 1,706 (+2565.63%)
Mutual labels:  timezones
Countries
Laravel countries and currencies
Stars: ✭ 1,564 (+2343.75%)
Mutual labels:  timezones
Pendulum
Python datetimes made easy
Stars: ✭ 4,639 (+7148.44%)
Mutual labels:  timezones
Spacetime
A lightweight javascript timezone library
Stars: ✭ 3,463 (+5310.94%)
Mutual labels:  timezones
dayjs
Extended fork of Day.js - 2KB immutable date library alternative to Moment.js
Stars: ✭ 36 (-43.75%)
Mutual labels:  timezones
ng2-timezone-selector
A simple Angular module to create a timezone selector using moment-timezone.
Stars: ✭ 12 (-81.25%)
Mutual labels:  timezones
django-timezone-field
A Django app providing DB, form, and REST framework fields for zoneinfo and pytz timezone objects.
Stars: ✭ 322 (+403.13%)
Mutual labels:  timezones
tz-trout
Helps you figure out the time zone based on an address or a phone number.
Stars: ✭ 14 (-78.12%)
Mutual labels:  timezones
timezone-soft
parse informal timezone names
Stars: ✭ 16 (-75%)
Mutual labels:  timezones

Ziptz

Version Build Status Total Downloads License

Get time zone, daylight saving time, and base offset for any US ZIP code.

ZIP codes are up to date as of August 2022.

Compatibility

Ziptz is tested to work with the following versions of Ruby:

  • Ruby 2.3.x, 2.4.x, 2.5.x, 2.6.x, 2.7.x, 3.x

Installation

Add the gem to your Gemfile:

gem 'ziptz'

Usage

Get the time zone name for any ZIP code:

z = Ziptz.new
z.time_zone_name('97213') #=> "America/Los_Angeles"

Get the time zone offset for any ZIP code:

z.time_zone_offset('97213') #=> -28800

Note that offsets do not include daylight saving time.

Determine if the ZIP code uses Daylight Saving Time:

z.time_zone_uses_dst?('97213') #=> true

Get all the zip codes in a time zone:

z.zips('Pacific/Chuuk') #=> ["96942", "96943"]

Supported Time Zones

  • America/Adak
  • America/Anchorage
  • America/Boise
  • America/Chicago
  • America/Denver
  • America/Detroit
  • America/Indiana/Indianapolis
  • America/Indiana/Knox
  • America/Indiana/Marengo
  • America/Indiana/Petersburg
  • America/Indiana/Tell_City
  • America/Indiana/Vevay
  • America/Indiana/Vincennes
  • America/Indiana/Winamac
  • America/Juneau
  • America/Kentucky/Louisville
  • America/Kentucky/Monticello
  • America/Los_Angeles
  • America/Menominee
  • America/Metlakatla
  • America/New_York
  • America/Nome
  • America/North_Dakota/Beulah
  • America/North_Dakota/Center
  • America/North_Dakota/New_Salem
  • America/Phoenix
  • America/Puerto_Rico
  • America/Sitka
  • America/St_Thomas
  • America/Yakutat
  • Pacific/Chuuk
  • Pacific/Guam
  • Pacific/Honolulu
  • Pacific/Kosrae
  • Pacific/Kwajalein
  • Pacific/Majuro
  • Pacific/Pago_Pago
  • Pacific/Palau
  • Pacific/Pohnpei
  • Pacific/Saipan
  • Pacific/Wake

Note that APO/FPO zip codes will not return a known time zone offset.

Prefer raw data?

If you would prefer raw data instead of a gem, see my ZIP Code Time Zones product on AWS Data Exchange to subscribe.

Version 3 breaking changes

  • APO, DPO, and FPO zip codes are no longer included, because they are non-geographic.
  • Time zone offsets are now specified in seconds instead of hours.
  • Time zone are now more granular. The full list of time zones is:
    • America/Adak
    • America/Anchorage
    • America/Boise
    • America/Chicago
    • America/Denver
    • America/Detroit
    • America/Indiana/Indianapolis
    • America/Indiana/Knox
    • America/Indiana/Marengo
    • America/Indiana/Petersburg
    • America/Indiana/Tell_City
    • America/Indiana/Vevay
    • America/Indiana/Vincennes
    • America/Indiana/Winamac
    • America/Juneau
    • America/Kentucky/Louisville
    • America/Kentucky/Monticello
    • America/Los_Angeles
    • America/Menominee
    • America/Metlakatla
    • America/New_York
    • America/Nome
    • America/North_Dakota/Beulah
    • America/North_Dakota/Center
    • America/North_Dakota/New_Salem
    • America/Phoenix
    • America/Puerto_Rico
    • America/Sitka
    • America/St_Thomas
    • America/Yakutat
    • Pacific/Chuuk
    • Pacific/Guam
    • Pacific/Honolulu
    • Pacific/Kosrae
    • Pacific/Kwajalein
    • Pacific/Majuro
    • Pacific/Pago_Pago
    • Pacific/Palau
    • Pacific/Pohnpei
    • Pacific/Saipan
    • Pacific/Wake

Version 2 breaking changes

Time zone names now reflect standard tz-database names.

V1 Name V2 Name
Atlantic America/Puerto_Rico
Eastern America/New_York
Central America/Chicago
Mountain America/Denver
Pacific America/Los_Angeles
Hawaii-Aleutian Islands Pacific/Honolulu or America/Adak
American Samoa Pacific/Pago_Pago
Marshall Islands Pacific/Majuro
Guam Pacific/Guam
Palau Pacific/Palau
Micronesia Pacific/Pohnpei

License

Copyright (c) 2015-2022 Keith Morrison <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].