cURL 复制
curl -X POST "https://cx4.cn/openApi/dev/timestamp" -H "X-Api-Key: 你的SecretKey" -d "action=to_date×tamp=1760000000&datetime=2026-10-03 11:00:00&format=Y年m月d日&timezone=Asia/Shanghai"
JavaScript 复制
fetch('https://cx4.cn/openApi/dev/timestamp', {
method: 'POST',
headers: {
'X-Api-Key': '你的SecretKey',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: 'action=to_date×tamp=1760000000&datetime=2026-10-03 11:00:00&format=Y年m月d日&timezone=Asia/Shanghai'
})
.then(res => res.json())
.then(data => console.log(data));
PHP 复制
post('https://cx4.cn/openApi/dev/timestamp', [
'headers' => ['X-Api-Key' => '你的SecretKey'],
'form_params' => ['action' => 'to_date', 'timestamp' => '1760000000', 'datetime' => '2026-10-03 11:00:00', 'format' => 'Y年m月d日', 'timezone' => 'Asia/Shanghai'],
]);
echo $response->getBody();
Java 复制
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://cx4.cn/openApi/dev/timestamp"))
.header("X-Api-Key", "你的SecretKey")
.header("Content-Type", "application/x-www-form-urlencoded")
.POST(HttpRequest.BodyPublishers.ofString("action=to_date×tamp=1760000000&datetime=2026-10-03 11:00:00&format=Y年m月d日&timezone=Asia/Shanghai"))
.build();
HttpResponse response = client.send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Python 复制
import requests
res = requests.post('https://cx4.cn/openApi/dev/timestamp',
headers={'X-Api-Key': '你的SecretKey'},
data={'action': 'to_date', 'timestamp': '1760000000', 'datetime': '2026-10-03 11:00:00', 'format': 'Y年m月d日', 'timezone': 'Asia/Shanghai'})
print(res.json())