Bybit服務器時間
獲取Bybit服務器時間
HTTP 請求
GET /v5/market/time
請求參數
無
響應參數
參數 | 類型 | 說明 |
---|---|---|
timeSecond | string | Bybit服務器時間戳 (秒) |
timeNano | string | Bybit 服務器時間戳 (微秒) |
請求示例
- HTTP
- Python
- Go
- Java
- Node.js
GET /v5/market/time HTTP/1.1
Host: api.bybit.com
from pybit.unified_trading import HTTP
session = HTTP(testnet=True)
print(session.get_server_time())
import (
"context"
"fmt"
bybit "github.com/wuhewuhe/bybit.go.api"
)
client := bybit.NewBybitHttpClient("", "", bybit.WithBaseURL(bybit.TESTNET))
client.NewUtaBybitServiceNoParams().GetServerTime(context.Background())
import com.bybit.api.client.service.BybitApiClientFactory;
var client = BybitApiClientFactory.newInstance().newAsyncMarketDataRestClient();
client.getServerTime(System.out::println);
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
});
client
.getServerTime()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "OK",
"result": {
"timeSecond": "1688639403",
"timeNano": "1688639403423213947"
},
"retExtInfo": {},
"time": 1688639403423
}