mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 10:34:27 +00:00
963 B
Executable File
963 B
Executable File
Time
An m3o.com API. For example usage see m3o.com/time/api.
Endpoints:
Zone
Get the timezone info for a specific location
package example
import(
"fmt"
"os"
"go.m3o.com/time"
)
// Get the timezone info for a specific location
func GetTheTimezoneInfoForAspecificLocation() {
timeService := time.NewTimeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := timeService.Zone(&time.ZoneRequest{
Location: "London",
})
fmt.Println(rsp, err)
}
Now
Get the current time
package example
import(
"fmt"
"os"
"go.m3o.com/time"
)
// Get the current time
func ReturnsCurrentTimeOptionallyWithLocation() {
timeService := time.NewTimeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := timeService.Now(&time.NowRequest{
})
fmt.Println(rsp, err)
}