令牌不是主机的系统时间

The token is not the host machine's system time

在我使用的主机中:

curl -k -X 'POST' -v http://10.1.1.186:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username": "guol", "password":"123456"}}}' -H 'Content-type: application/json' | python -mjson.tool

生成令牌:

...
* Closing connection 0
{
    "access": {
        "metadata": {
            "is_admin": 0,
            "roles": []
        },
        "serviceCatalog": [],
        "token": {
            "audit_ids": [
                "HqVGww9JT2G2wSKzd9v3uA"
            ],
            "expires": "2017-08-16T13:16:14Z",
            "id": "gAAAAABZlDeOO4s1MCfXFP_b9CTl_Znndpt6piBxLRiMTR2TpMp3EfA49chql2a1nfowQST-pQCqaBe53KBuRNx4moj3RYCIiS24xDALDhqpeYBSkfnVM1EP6dTSKOtEGuQGBNGe5v4RIlzu0ZXKYrmoWPgA7ZFRiw",
            "issued_at": "2017-08-16T12:16:14.000000Z"
        },
        "user": {
            "id": "2a5fa182fb1b459980db09cd1572850e",
            "name": "admin",
            "roles": [],
            "roles_links": [],
            "username": "admin"
        }
    }
}

我获得令牌成功,但是我的主机时间是:2017/8/16 20:18,但令牌时间如下:

"issued_at": "2017-08-16T12:16:14.000000Z"
"expires": "2017-08-16T13:16:14Z"

编辑

主机时区是Asia/Shanghai

JSON 文件中返回的时间戳表示为 UTC。你可以这么说,因为它使用了 Z 后缀。

根据ISO 8601

UTC

If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "0930Z". "14:45:15 UTC" would be "14:45:15Z" or "144515Z".