Package timezones provides an array of timezones as well as a simple API for accessing and searching timezones.
Package timezones provides an slice of timezones as well as a simple API for accessing and searching timezones.
Package timezone provides two ways to retrieve the timezone for any latitude,longitude position. https://developers.google.com/maps/documentation/timezone/ This API is free and limits you to 2,500 calls a day. You will receive a GoogleTimezone object if the call is successful. http://www.geonames.org/ This API is free with registration and has no limit. If you upgrade to a premium account you can be guaranteed fast and reliable response times. The TimezoneID is a location name corresponding to the IANA Time Zone database. Go provides this database in the /lib/time/zoneinfo.zip file. Because of this we can use the TimezoneID within the time package:
Package localtimezone provides timezone lookup for a given location * The timezone shapefile is embedded in the build binary using go-bindata * Supports overlapping zones * You can load your own geojson shapefile if you want * Sub millisecond lookup even on old hardware * The shapefile is simplified using a lossy method so it may be innacurate along the borders * This is purely in-memory. Uses ~50MB of ram
Package tzf is a package convert (lng,lat) to timezone. Inspired by timezonefinder https://github.com/jannikmi/timezonefinder, fast python package for finding the timezone of any point on earth (coordinates) offline.
Package epochdate provides date handling in a compact format. Represents dates from Jan 1 1970 - Jun 6 2149 as days since the Unix epoch. This format requires 2 bytes (it's a uint16), in contrast to the 16 or 20 byte representations (on 32 or 64-bit systems, respectively) used by the standard time package. Timezone is accounted for when applicable; when converting from standard time format into a Date, the date relative to the time value's zone is retained. Times at any point during a given day (relative to timezone) are normalized to the same date. Conversely, conversions back to standard time format may be done using the Local, UTC, and In methods (semantically corresponding to the same-named Time methods), but with the result normalized to midnight (the beginning of the day) relative to that timezone. All functions and methods with the same names as those found in the stdlib time package have identical semantics in epochdate, with the exception that epochdate truncates time-of-day information.