严格的来说,这个标题可能不太正确,因为我首先度娘了一下,ISO8601时间格式标准应该类似于:2016-01-18T23:41:00-08:00,而UTC时间格式差不多类似
在做一个项目用到一个国外的API,返回的一个时间格式是:2016-01-18T23:41:00
我有几个问题想问一下:
1.因为没有搜索到具体资料,返回的这个2016-01-18T23:41:00 是UTC时间和是ISO-8601时间格式?
2.如上,如果这算是ISO时间格式,因为没有指定时区,那么像“2016-01-18T23:41:00”这种情况,默认是+00:00吗?(如果是UTC时间,也是类似的问题,没有指定时区/时差默认的是什么,如果有)
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
维基百科:
Time zones in ISO 8601 are represented as local time (with the location unspecified), as UTC, or as an offset from UTC.
If no UTC relation information is given with a time representation, the time is assumed to be in local time.
所以如果不指定时区,则表示的是本地时间。相当于localtime得到的时间。没指定时区不代表UTC时间,UTC时间必须最后写明Z或者用+00之类的偏移。
那个T的意义仅仅是分隔符,没有别的意思。