对于RFC3339 标准中允许的时间分隔符/指示符,我感到非常困惑。时间分隔符是指在日期和时间之间划定界限的字符序列。
该标准在第 5.6 节中陈述了不清楚或相互矛盾的不同事物。首先,它说完整日期时间的生产规则是这样的:
date-time = full-date "T" full-time
这意味着日期和时间之间的分隔符是大写的T
。紧随其后的是:
NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
syntax may alternatively be lower case "t" or "z" respectively
意思是大写T
可能是小写t
。它与 ABNF 冲突,但好吧,在我看来,它仍然在合理的范围内。然后声明如下
NOTE: ISO 8601 defines date and time separated by "T".
Applications using this syntax may choose, for the sake of
readability, to specify a full-date and full-time separated by
(say) a space character.
这非常令人困惑。这是否不仅允许空格字符,还允许任何内容?这就是这say
意味着什么。还是this syntax
参考 ISO8601 并不必要地描述了其他标准的细节?
换句话说,以下是有效的 RFC3339 字符串吗?
2020-09-07 20:26:03.623359300+02:00
2020-09-07hey johnny20:26:03.623359300+02:00
2020-09-0720:26:03.623359300+02:00