geotimezone

package
v0.0.0-...-3d7c4f9 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package geotimezone provides timezone data from coordinates http://www.geonames.org/export/web-services.html#timezone

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timezone

type Timezone struct {
	TimezoneId  string `json:"timezoneId"`
	CountryCode string `json:"countryCode"`
	CountryName string `json:"countryName"`

	GmtOffset int `json:"gmtOffset"`
	RawOffset int `json:"rawOffset"`
	DstOffset int `json:"dstOffset"`

	Lat float32 `json:"lat"`
	Lon float32 `json:"lng"`
}

Timezone data as reported by geonames timezone JSON service http://www.geonames.org/export/web-services.html#timezone

{
  "sunrise": "2016-06-09 05:24",
  "lng": 10.2,
  "countryCode": "AT",
  "gmtOffset": 1,
  "rawOffset": 1,
  "sunset": "2016-06-09 21:13",
  "timezoneId": "Europe/Vienna",
  "dstOffset": 2,
  "countryName": "Austria",
  "time": "2016-06-09 00:36",
  "lat": 47.01
}

func GetTimezone

func GetTimezone(requester geoclient.Requester, lon string, lat string) (Timezone, error)

GetTimezone returns timezone data for given longitude and latitude

Jump to

Keyboard shortcuts

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