cURL
curl "http://xfxuezhang.cn:8082/api/timestamp?timestamp=1735689600&datetime=2025-01-01+00%3A00%3A00"
时间戳与日期字符串互转。
http://xfxuezhang.cn:8082/api/timestamp
接口调用前需要确认的核心配置。
/api/timestamptimestamp必填参数必须传入,示例值可直接用于联调。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
timestamp |
否 | integer | Unix时间戳。 | 1735689600 |
datetime |
否 | string | 日期时间字符串。 | 2025-01-01 00:00:00 |
优先使用示例地址测试请求参数是否正确。
http://xfxuezhang.cn:8082/api/timestamp?timestamp=1735689600&datetime=2025-01-01+00%3A00%3A00
curl "http://xfxuezhang.cn:8082/api/timestamp?timestamp=1735689600&datetime=2025-01-01+00%3A00%3A00"
$url = 'http://xfxuezhang.cn:8082/api/timestamp?timestamp=1735689600&datetime=2025-01-01+00%3A00%3A00';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('http://xfxuezhang.cn:8082/api/timestamp?timestamp=1735689600&datetime=2025-01-01+00%3A00%3A00')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "timestamp",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
integer | 业务状态码,0 表示请求成功。 | 0 |
msg |
string | 接口调用结果说明。 | success |
data |
object | 接口返回的业务数据。具体字段以对应 API 为准。 | {} |
点击左侧“发送请求”查看结果...