# How can I get the time zone of a US ZIP code?

There does not seem to be a direct way to extract the time zone for a ZIP code. Currently, I am first mapping the ZIP code to the states, and then getting the time zones for those states.

"94402" //
Entity["ZIPCode", #] & //
EntityValue[#, "USStates"] & //
Map[EntityValue[#, "TimeZones"] &]


But this is obviously wrong. This will return multiple time zones even when a given ZIP code lies within a single time zone.

Is there a better way of getting the time zone for a ZIP code through Entity?

TimeZoneOffset[Entity["ZIPCode", "94402"]]


-8.

• Ah, didn't occur to me that I don't need to wrap the entity in GeoPosition. Ah well. Graceful method :) – Carl Lange Jan 11 at 0:44
• Thank you @CarlLange. – kglr Jan 11 at 1:23

This will do what you want:

TimeZoneOffset[GeoPosition[Entity["ZIPCode", "94402"]["Coordinates"]]]


-8

Each zip code entity has coordinates associated with them, and TimeZoneOffset can take a GeoPosition and return the timezone offset from GMT.

It should be noted that kglr's answer is the shorter (and more graceful) form of this answer - they are doing the same thing under the hood.