[乐意黎原创] 时间格式 yyyy-MM-dd‘T‘HH:mm:ss.SSSZ 中的T和Z表示什么

1. 事情起因:

本人这久在关注一个地方域名( ***.ren,由于某些因素,此处用 *** 来代表域名),

因域名已经过期,有打算抢注的意愿,就等域名注册机构删除后我来抢注册了。

( ***.ren)
注册日期 2014年10月15日 
到期日期 2017年10月30日
到期日期 10月30日

每天的查询记录:
2017.11.08 未删
2017.11.28 未删
2017.11.30 未删
2017.12.01 未删
2017.12.02 未删

2017.12.03 未删
2017.12.04 未删

无耐,()2017-12-05) 今早10点多一看,域名竟然被抢注册了。

2017.12.05  注册了

突然间这种失落啊。。。 关注这么久,竟然失之交臂了。。。
有点欲哭无泪,万念俱灰的感觉

(***.ren)

Updated Date:2017-12-04T18:07:57Z
Creation Date:2017-12-04T18:07:44Z
Registry Expiry Date:2018-12-04T18:07:44Z

换算成北京时间:
Updated Date:2017-12-05 02:07:57
Creation Date:2017-12-05 02:07:44
Registry Expiry Date:2018-12-05 02:07:44

 折腾了下,突然明白了。原来是北京时间5号的凌晨2时左右抢注的啊.

哎,这久花的精力和时间白白浪费和。
期初一直没怎么留意和关注过域名展示的这种时间格式,(我也太孤陋寡闻了) 哎。
究其原因,还没有深刻理解 yyyy-MM-dd'T'HH:mm:ss.SSSZ 这种时间格式中的T和Z所表示的含义。


2. 原因  yyyy-MM-dd'T'HH:mm:ss.SSSZ 时间格式 解释

下面来着重认识一下:

Date Time String Format

ECMAScript defines a string interchange format for date-times based upon a simplification of the ISO 8601 Extended Format. The format is as follows: YYYY-MM-DDTHH:mm:ss.sssZ

Where the fields are as follows:

YYYYis the decimal digits of the year 0000 to 9999 in the Gregorian calendar.
-"-" (hyphen) appears literally twice in the string.
MMis the month of the year from 01 (January) to 12 (December).
DDis the day of the month from 01 to 31.
T"T" appears literally in the string, to indicate the beginning of the time element.
HHis the number of complete hours that have passed since midnight as two decimal digits from 00 to 24.
:":" (colon) appears literally twice in the string.
mmis the number of complete minutes since the start of the hour as two decimal digits from 00 to 59.
ssis the number of complete seconds since the start of the minute as two decimal digits from 00 to 59.
."." (dot) appears literally in the string.
sssis the number of complete milliseconds since the start of the second as three decimal digits.
Zis the time zone offset specified as "Z" (for UTC) or either "+" or "-" followed by a time expression HH:mm

上面这个时间格式就是带T和Z这种是ISODATE .

Z ( zero )是表示0时区,

对我们国家来说, 采用北京时间, 处于东八区.UTC+8 , 所以,
带Z的时间格式, 转换成北京时间需要加上 8 个小时.


例如:
Updated Date:2017-10-20T02:59:25Z  转换成北京时间: UTC+8 就是 2017-10-20 10:59:25

Creation Date:2015-08-03T07:21:33Z 转换成北京时间: UTC+8 就是 2015-08-03 15:21:33


3. 最后

至此,算是彻底倒腾明白了。

参考网址: http://www.ecma-international.org/ecma-262/6.0/#sec-date-time-string-format 


 乐意黎原创

本文地址:  http://blog.csdn.net/aerchi/article/details/78717232

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值