POST

服务器时间

获取平台服务器当前 UTC 时间

接口路径 /open/v1/time

完整调用地址请登录控制台,在「我的密钥」页查看。

请求说明

返回服务器当前 UTC 时间,可用于客户端时钟校准。

扣费:1 点/次。

调用地址:请登录控制台,在「我的密钥」页查看完整 API 调用地址。公开文档仅展示接口路径 /open/v1/{slug}。示例中的 <调用地址> 请替换为控制台中的实际地址。

请求体 (JSON)

参数类型必填说明
(无)-无需请求体,POST 空请求即可

响应字段

字段类型说明
utcstringUTC 时间,RFC3339 格式
unixintegerUnix 时间戳(秒)
timezonestring固定为 UTC

调用示例

curl -X POST -H "X-API-Key: sk-your-key" "<调用地址>/time"
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest(http.MethodPost, "<调用地址>/time", nil)
    req.Header.Set("X-API-Key", "sk-your-key")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
<?php
$ch = curl_init('<调用地址>/time');
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ['X-API-Key: sk-your-key'],
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("<调用地址>/time"))
    .header("X-API-Key", "sk-your-key")
    .POST(HttpRequest.BodyPublishers.noBody())
    .build();

HttpResponse<String> response = client.send(
    request,
    HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
const response = await fetch('<调用地址>/time', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk-your-key',
  },
});

const data = await response.json();
console.log(data);

响应示例

{"utc":"2026-05-29T12:00:00Z","unix":1716988800,"timezone":"UTC"}