I have US ZIP codes, now I need to get their respective time zones. Could you please help me with any mapping file or Python or R code for this.
Use "Ziptz" library for this. Usage:
z = Ziptz.new
z.time_zone_name('zipcode')
Result:
Pacific
Get all the zip codes in a time zone
z.zips('American Samoa') #=> ["96799", "96941", "96942", "96943", "96944"]
Supported Timezone
For more: ziptz
For Python
Install
pip install pyzipcode
Usage:
from pyzipcode import ZipCodeDatabase
zcdb = ZipCodeDatabase()
zipcode = zcdb[54115]
To get City Name:
zipcode.city
Result
u'De Pere'
To Get Timezone
zipcode.timezone
Result:
-6
For more: pyzipcode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With