接口简介:
查询全球所有国家及特殊地区当前时间。
请求地址:
https://cn.apihz.cn/api/time/timecountry.php
请求方式:
POST或GET。
请求参数:
【名称】【参数】【必填】【说明】
【用户ID】【id】【是】【用户中心的数字ID,例:id=10000000】
【用户KEY】【key】【是】【用户中心通讯秘钥,例:key=15he5h15ty854j5sr152hs2】
【名称】【country】【是】【支持查询所有国家,及特殊地区如夏威夷等。可传中文名称如:美国,英文名称如:United States,ISO2简称如:US,部分别名如:法兰西。例:country=美国】
返回参数:
【名称】【参数】【说明】
【状态码】【code】【200成功,400错误】
【信息提示】【msg】【信息提示】
【数据集】【data】【数据集】
【国家基础信息数据集】【data.country】【国家基础信息数据集】
【中文国家名】【data.country.cn】【中文国家名】
【英文国家名】【data.country.en】【英文国家名】
【iso2代码】【data.country.iso2】【ISO 3166‑2 国家代码】
【首都纬度】【data.country.lat】【首都纬度】
【首都经度】【data.country.lng】【首都经度】
【UTC范围】【data.country.utc_offset】【理论 UTC 范围】
【全球统一时间数据集】【data.utc_time】【全球统一时间数据集】
【Unix 时间戳】【data.utc_time.timestamp】【Unix 时间戳】
【格式化时间】【data.utc_time.datetime】【格式化时间】
【星期几】【data.utc_time.weekday】【星期几】
【中文星期】【data.utc_time.weekday_cn】【中文星期】
【国家所有时区数据集】【data.timezones】【该国家或地区所有时区数据集对象】
【IANA 时区】【data.timezones.timezone】【IANA 时区 ID】
【时区中文名】【data.timezones.timezone_cn】【时区中文名】
【当地当前时间】【data.timezones.current_time】【当地当前时间】
【 UTC偏移】【data.timezones.offset】【UTC 偏移】
【是否夏令时】【data.timezones.is_dst】【是否夏令时】
【理论标准时区数据集】【data.timezones.standard】【理论标准时区数据集】
【时区偏移名】【data.timezones.standard.name】【时区偏移名】
【偏移秒数】【data.timezones.standard.offset_seconds】【偏移秒数】
【偏移小时数】【data.timezones.standard.offset_hours】【偏移小时数】
【是否夏令时】【data.timezones.standard.is_dst】【是否夏令时】
【iana时区数据集】【data.timezones.iana】【iana时区数据集】
【IANA 时区】【data.timezones.iana.name】【IANA 时区】
【当前偏移】【data.timezones.iana.offset】【当前偏移】
【夏令时】【data.timezones.iana.is_dst】【夏令时】
【国家代码】【data.timezones.iana.country_code】【国家代码】
【国家中文名】【data.timezones.iana.country_cn】【国家中文名】
【国家英文名】【data.timezones.iana.country_en】【国家英文名】
【查询摘要数据集】【data.summary】【本次查询摘要数据集】
【时区数量】【data.summary.timezone_count】【该国家或地区所有时区数量】
【是否多时区】【data.summary.has_multiple_timezones】【是否多时区】
【服务器时间】【data.summary.query_time】【接口服务器时间】
GET请求示例:
https://cn.apihz.cn/api/time/timecountry.php?id=88888888&key=88888888&country=美国
注意:示例里的ID与KEY为公共ID与KEY,共享每分钟调用频次限制,接口本身免费,请使用自己的ID与KEY,独享每分钟调用频次。每日调用无上限。
POST请求示例:
请根据开发语言自行POST。
返回数据示例:
示例:{"code":400,"msg":"通讯秘钥错误。"}
示例:
{
"code": 200,
"msg": "success",
"data": {
"country": {
"cn": "中国",
"en": "China",
"iso2": "CN",
"lat": 39.9042,
"lng": 116.4074,
"utc_offset": "UTC+8"
},
"utc_time": {
"timestamp": 1780027780,
"datetime": "2026-05-29 04:09:40",
"weekday": "5",
"weekday_cn": "星期五"
},
"timezones": [{
"timezone": "Asia/Shanghai",
"timezone_cn": "上海(中国)",
"current_time": "2026-05-29 12:09:40",
"offset": "UTC+8",
"is_dst": false,
"standard": {
"name": "UTC+8",
"offset_seconds": 28800,
"offset_hours": 8,
"is_dst": false
},
"iana": {
"name": "Asia/Shanghai",
"offset": "UTC+8",
"is_dst": false,
"country_code": "CN",
"country_cn": "中国",
"country_en": "China"
}
}],
"summary": {
"timezone_count": 1,
"has_multiple_timezones": false,
"query_time": "2026-05-29 12:09:40"
}
}
}
示例:
{
"code": 200,
"msg": "success",
"data": {
"country": {
"cn": "美国",
"en": "United States",
"iso2": "US",
"lat": 38.9072,
"lng": -77.0369,
"utc_offset": "UTC-5 ~ UTC-10"
},
"utc_time": {
"timestamp": 1780027794,
"datetime": "2026-05-29 04:09:54",
"weekday": "5",
"weekday_cn": "星期五"
},
"timezones": [{
"timezone": "America/New_York",
"timezone_cn": "纽约(美国东部)",
"current_time": "2026-05-29 00:09:54",
"offset": "UTC-4",
"is_dst": true,
"standard": {
"name": "UTC-4",
"offset_seconds": -14400,
"offset_hours": -4,
"is_dst": true
},
"iana": {
"name": "America/New_York",
"offset": "UTC-4",
"is_dst": true,
"country_code": "US",
"country_cn": "美国",
"country_en": "United States"
}
}, {
"timezone": "America/Chicago",
"timezone_cn": "芝加哥(美国中部)",
"current_time": "2026-05-28 23:09:54",
"offset": "UTC-5",
"is_dst": true,
"standard": {
"name": "UTC-5",
"offset_seconds": -18000,
"offset_hours": -5,
"is_dst": true
},
"iana": {
"name": "America/Chicago",
"offset": "UTC-5",
"is_dst": true,
"country_code": "US",
"country_cn": "美国",
"country_en": "United States"
}
}, {
"timezone": "America/Denver",
"timezone_cn": "丹佛(美国山地)",
"current_time": "2026-05-28 22:09:54",
"offset": "UTC-6",
"is_dst": true,
"standard": {
"name": "UTC-6",
"offset_seconds": -21600,
"offset_hours": -6,
"is_dst": true
},
"iana": {
"name": "America/Denver",
"offset": "UTC-6",
"is_dst": true,
"country_code": "US",
"country_cn": "美国",
"country_en": "United States"
}
}, {
"timezone": "America/Phoenix",
"timezone_cn": "凤凰城(美国亚利桑那)",
"current_time": "2026-05-28 21:09:54",
"offset": "UTC-7",
"is_dst": false,
"standard": {
"name": "UTC-7",
"offset_seconds": -25200,
"offset_hours": -7,
"is_dst": false
},
"iana": {
"name": "America/Phoenix",
"offset": "UTC-7",
"is_dst": false,
"country_code": "US",
"country_cn": "美国",
"country_en": "United States"
}
}, {
"timezone": "America/Los_Angeles",
"timezone_cn": "洛杉矶(美国太平洋)",
"current_time": "2026-05-28 21:09:54",
"offset": "UTC-7",
"is_dst": true,
"standard": {
"name": "UTC-7",
"offset_seconds": -25200,
"offset_hours": -7,
"is_dst": true
},
"iana": {
"name": "America/Los_Angeles",
"offset": "UTC-7",
"is_dst": true,
"country_code": "US",
"country_cn": "美国",
"country_en": "United States"
}
}, {
"timezone": "America/Anchorage",
"timezone_cn": "安克雷奇(阿拉斯加)",
"current_time": "2026-05-28 20:09:54",
"offset": "UTC-8",
"is_dst": true,
"standard": {
"name": "UTC-8",
"offset_seconds": -28800,
"offset_hours": -8,
"is_dst": true
},
"iana": {
"name": "America/Anchorage",
"offset": "UTC-8",
"is_dst": true,
"country_code": "US",
"country_cn": "美国",
"country_en": "United States"
}
}, {
"timezone": "Pacific/Honolulu",
"timezone_cn": "檀香山(夏威夷)",
"current_time": "2026-05-28 18:09:54",
"offset": "UTC-10",
"is_dst": false,
"standard": {
"name": "UTC-10",
"offset_seconds": -36000,
"offset_hours": -10,
"is_dst": false
},
"iana": {
"name": "Pacific/Honolulu",
"offset": "UTC-10",
"is_dst": false,
"country_code": "US",
"country_cn": "美国",
"country_en": "United States"
}
}],
"summary": {
"timezone_count": 7,
"has_multiple_timezones": true,
"query_time": "2026-05-29 12:09:54"
}
}
}
参考资料(版权):
https://www.apihz.cn/api/timetimecountry.html