日期字符串中的T与Z

日期格式:YYYY-MM-DDTHH:mm:ss.sssZ

解析:

LocalDateTime.parse(日期字符串, DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"));

以下内容引用自:https://262.ecma-international.org/6.0/#sec-date-time-string-format

20.3.1.16Date 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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wsdhla

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值