worldtime

package module
v0.0.0-...-42c5848 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 6 Imported by: 0

README

go-worldtime

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EndpointAPI      = "https://worldtimeapi.org/api"
	EndpointTimezone = EndpointAPI + "/timezone"
)

Functions

func EndpointTimezoneLocation

func EndpointTimezoneLocation(area, location, region string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) Time

func (client *Client) Time(args ...string) (*Time, error)

type Error

type Error struct {
	Err string `json:"error"`
}

func (*Error) Error

func (e *Error) Error() string

type Time

type Time struct {
	Abbreviation string    `json:"abbreviation"`
	ClientIP     string    `json:"client_ip"`
	Datetime     time.Time `json:"datetime"`
	DayOfWeek    int       `json:"day_of_week"`
	DayOfYear    int       `json:"day_of_year"`
	DST          bool      `json:"dst"`
	DSTFrom      time.Time `json:"dst_from"`
	DSTOffset    int       `json:"dst_offset"`
	DSTUntil     time.Time `json:"dst_until"`
	RawOffset    int       `json:"raw_offset"`
	Timezone     string    `json:"timezone"`
	Unixtime     int       `json:"unixtime"`
	UTCDatetime  time.Time `json:"utc_datetime"`
	UTCOffset    string    `json:"utc_offset"`
	WeekNumber   int       `json:"week_number"`
}

type Timezones

type Timezones []string

Jump to

Keyboard shortcuts

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