goziptz

package module
v0.0.0-...-05f486c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 7 Imported by: 0

README

goziptz

goziptz is a Go library for mapping US zip codes to time.Location. It's a port of nfused/ziptz Ruby library.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidZip is returned when zip code is not in zip or zip+4 formats.
	ErrInvalidZip = errors.New("invalid zip code")

	// ErrLocationNotFound is returned when location for passed zip code is not found.
	ErrLocationNotFound = errors.New("error location not found")
)

Functions

func ZipToLocation

func ZipToLocation(zip string) (*time.Location, error)

ZipToLocation returns IANA timezone of the US zip code. The zip code can either be 5 digit format ("94606") or 5+4 digit format ("94606-1234").

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL