{
    "openapi": "3.0.0",
    "info": {
        "title": "全球时间查询 - API文档",
        "version": "1.0.0",
        "description": "查询全球主要城市的时间，返回中英文名称、时区、国家代码和中英文的时间以及是否实行夏令时制度等。目前支持全球100个国家共160个城市，如返回为空可查询同一时区的其他城市，或者联系客服增加。例如：中国实行全国统一时区，其他城市查询北京时间即可。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/worldtime\/index": {
            "get": {
                "summary": "查询全球地区时间",
                "tags": [
                    "全球时间查询"
                ],
                "description": "根据地区名查询对应时区等信息",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "城市中文或英文",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "上海",
                            "description": "城市中文或英文"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "city": {
                                            "type": "string",
                                            "example": "上海",
                                            "description": "城市"
                                        },
                                        "noon": {
                                            "type": "string",
                                            "example": "下午",
                                            "description": "时刻"
                                        },
                                        "week": {
                                            "type": "string",
                                            "example": "四",
                                            "description": "星期"
                                        },
                                        "encity": {
                                            "type": "string",
                                            "example": "Shanghai",
                                            "description": "城市英文"
                                        },
                                        "ennoon": {
                                            "type": "string",
                                            "example": "PM",
                                            "description": "时刻英文"
                                        },
                                        "enweek": {
                                            "type": "string",
                                            "example": "Thu",
                                            "description": "星期英文"
                                        },
                                        "country": {
                                            "type": "string",
                                            "example": "中国",
                                            "description": "所在国家"
                                        },
                                        "strtime": {
                                            "type": "string",
                                            "example": "2020-09-02 10:10:50",
                                            "description": "字符串时间"
                                        },
                                        "weeknum": {
                                            "type": "string",
                                            "example": "3",
                                            "description": "星期数字"
                                        },
                                        "nowmonth": {
                                            "type": "string",
                                            "example": "三",
                                            "description": "月份"
                                        },
                                        "timeZone": {
                                            "type": "string",
                                            "example": "GMT +8",
                                            "description": "时区"
                                        },
                                        "encountry": {
                                            "type": "string",
                                            "example": "China",
                                            "description": "国家英文"
                                        },
                                        "timestamp": {
                                            "type": "int",
                                            "example": 1598980240,
                                            "description": "时间戳"
                                        },
                                        "countryezm": {
                                            "type": "string",
                                            "example": "CN",
                                            "description": "国家二字码"
                                        },
                                        "ennowmonth": {
                                            "type": "string",
                                            "example": "Mar",
                                            "description": "月份英文"
                                        },
                                        "summertime": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "夏令时制度，0否、1是"
                                        },
                                        "countrycode": {
                                            "type": "string",
                                            "example": "86",
                                            "description": "国家电话代码"
                                        },
                                        "cursummertime": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "当前夏令时，0否、1是、2未知"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "city": "上海",
                                        "noon": "下午",
                                        "week": "四",
                                        "encity": "Shanghai",
                                        "ennoon": "PM",
                                        "enweek": "Thu",
                                        "country": "中国",
                                        "strtime": "2022-03-31 15:25:28",
                                        "weeknum": "4",
                                        "nowmonth": "三",
                                        "timeZone": "GMT+8",
                                        "encountry": "China",
                                        "timestamp": 1648711528,
                                        "countryezm": "CN",
                                        "ennowmonth": "Mar",
                                        "summertime": 0,
                                        "countrycode": "86",
                                        "cursummertime": 0
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "查询全球地区时间",
                "tags": [
                    "全球时间查询"
                ],
                "description": "根据地区名查询对应时区等信息",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "city": {
                                        "type": "string",
                                        "example": "上海",
                                        "description": "城市中文或英文"
                                    }
                                },
                                "required": [
                                    "key",
                                    "city"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "city": {
                                            "type": "string",
                                            "example": "上海",
                                            "description": "城市"
                                        },
                                        "noon": {
                                            "type": "string",
                                            "example": "下午",
                                            "description": "时刻"
                                        },
                                        "week": {
                                            "type": "string",
                                            "example": "四",
                                            "description": "星期"
                                        },
                                        "encity": {
                                            "type": "string",
                                            "example": "Shanghai",
                                            "description": "城市英文"
                                        },
                                        "ennoon": {
                                            "type": "string",
                                            "example": "PM",
                                            "description": "时刻英文"
                                        },
                                        "enweek": {
                                            "type": "string",
                                            "example": "Thu",
                                            "description": "星期英文"
                                        },
                                        "country": {
                                            "type": "string",
                                            "example": "中国",
                                            "description": "所在国家"
                                        },
                                        "strtime": {
                                            "type": "string",
                                            "example": "2020-09-02 10:10:50",
                                            "description": "字符串时间"
                                        },
                                        "weeknum": {
                                            "type": "string",
                                            "example": "3",
                                            "description": "星期数字"
                                        },
                                        "nowmonth": {
                                            "type": "string",
                                            "example": "三",
                                            "description": "月份"
                                        },
                                        "timeZone": {
                                            "type": "string",
                                            "example": "GMT +8",
                                            "description": "时区"
                                        },
                                        "encountry": {
                                            "type": "string",
                                            "example": "China",
                                            "description": "国家英文"
                                        },
                                        "timestamp": {
                                            "type": "int",
                                            "example": 1598980240,
                                            "description": "时间戳"
                                        },
                                        "countryezm": {
                                            "type": "string",
                                            "example": "CN",
                                            "description": "国家二字码"
                                        },
                                        "ennowmonth": {
                                            "type": "string",
                                            "example": "Mar",
                                            "description": "月份英文"
                                        },
                                        "summertime": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "夏令时制度，0否、1是"
                                        },
                                        "countrycode": {
                                            "type": "string",
                                            "example": "86",
                                            "description": "国家电话代码"
                                        },
                                        "cursummertime": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "当前夏令时，0否、1是、2未知"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "city": "上海",
                                        "noon": "下午",
                                        "week": "四",
                                        "encity": "Shanghai",
                                        "ennoon": "PM",
                                        "enweek": "Thu",
                                        "country": "中国",
                                        "strtime": "2022-03-31 15:25:28",
                                        "weeknum": "4",
                                        "nowmonth": "三",
                                        "timeZone": "GMT+8",
                                        "encountry": "China",
                                        "timestamp": 1648711528,
                                        "countryezm": "CN",
                                        "ennowmonth": "Mar",
                                        "summertime": 0,
                                        "countrycode": "86",
                                        "cursummertime": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}