Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = New()
View Source
var (
ErrDeserialize = errors.New("Failed to deserialize")
)
View Source
var (
ErrInvalidResponse = errors.New("Received invalid response")
)
Functions ¶
func UnmarshalMonth ¶
func UnmarshalWeekday ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Search ¶
func (c *Client) Search(query string) (r []SearchResult, err error)
https://www.timeanddate.com/scripts/completion.php?query=!!QUERY¡¡&xd=1&mode=ci
type Date ¶
func (*Date) UnmarshalText ¶
type Position ¶
func (*Position) UnmarshalText ¶
e.g. 49°58'N / 9°09'E
type SearchResult ¶
type SearchResult struct { Path string // e.g. /worldclock/@2830841 Unused1 string // e.g. 5 CountryCode string // e.g. de Unused2 string // e.g. b City string // e.g. Bezirk Spandau (fifth-order administrative division) State string // e.g. Berlin Country string // e.g. Germany CountryFlag string // e.g. //c.tadst.com/gfx/n/fl/16/de.png Unused3 string // e.g. "" Unused4 string // e.g. "" Unused5 string // e.g. "p" Unused6 string // e.g. "" }
func Search ¶
func Search(query string) (r []SearchResult, err error)
performs search with DefaultClient
type TimeAndDate ¶
type TimeAndDate struct { Country string // e.g. Germany State *State // e.g. Bavaria (BY) Province *State // e.g. Bavaria (BY) Position *Position // e.g. 49°58'N / 9°09'E Elevation int // in meters Currency *Currency // e.g. Euro (EUR) Languages []string // e.g. German AccessCode string // e.g. +49 Time *Time // e.g. 12:54:53 Date *Date // e.g. Monday, 23 October 2023 }
func Get ¶
func Get(path string) (r *TimeAndDate, err error)
func (*TimeAndDate) TimeTime ¶
func (t *TimeAndDate) TimeTime() time.Time
returns time in UTC because easier // TODO: get data from time/zone/
Click to show internal directories.
Click to hide internal directories.