bybit.go.api/examples/market/server_time.go

25 lines
396 B
Go
Raw Normal View History

2023-10-30 20:26:54 +02:00
package main
import (
"context"
"fmt"
2023-11-03 16:29:17 +02:00
bybit "github.com/wuhewuhe/bybit.go.api"
2023-10-30 20:26:54 +02:00
)
func main() {
ServerTime()
}
func ServerTime() {
2023-11-03 16:29:17 +02:00
client := bybit.NewBybitHttpClient("", "")
2023-10-30 20:26:54 +02:00
// NewServerTimeService
2023-11-05 23:35:56 +02:00
serverTime, err := client.NewMarketInfoServiceNoParams().GetServerTime(context.Background())
2023-11-03 16:29:17 +02:00
if err != nil {
fmt.Println(err)
return
}
2023-10-30 20:26:54 +02:00
fmt.Println(bybit.PrettyPrint(serverTime))
}