HTML:时间格式中的字母T - 有什么作用?

4

这份文档http://www.w3.org/TR/NOTE-datetime详细介绍了日期和时间格式:

Examples

1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.

1994-11-05T13:15:30Z corresponds to the same instant.

完整日期加上小时、分钟、秒及小数秒

YYYY-MM-DDThh:mm:ss.sTZD (例如 1997-07-16T19:20:30.45+01:00)

其中:

 YYYY = four-digit year
 MM   = two-digit month (01=January, etc.)
 DD   = two-digit day of month (01 through 31)
 hh   = two digits of hour (00 through 23) (am/pm NOT allowed)
 mm   = two digits of minute (00 through 59)
 ss   = two digits of second (00 through 59)
 s    = one or more digits representing a decimal fraction of a second
 TZD  = time zone designator (Z or +hh:mm or -hh:mm)

1994-11-05T08:15:30中的T代表时间。
2个回答

10

格式部分的第二段开始:

请注意,字符串中字面上出现了"T",以指示时间元素的开头,如ISO 8601所指定的。


3

这只是一个分隔符,用于指定字符串中时间部分的开始位置。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接