开发者

html5 time element question

What is the format to add a millisecond to my time element? I know the basic format is YYYY-MM-DDThh:mm:ssTZD but what is it for the millisecond can someone gi开发者_JS百科ve me an example?


According to section 2.4.5.4 of the HTML5 draft specification, you can do it with a dot '.' following the seconds value.

Quoting the current draft (emphasis mine):

Optionally (required if second is non-zero):

  1. A ":" (U+003A) character
  2. Two ASCII digits, representing the integer part of second, in the range 0 ≤ s ≤ 59
  3. Optionally (required if second is not an integer):
    1. A 002E FULL STOP character (.)
    2. One, two, or three ASCII digits, representing the fractional part of second

For example:

2011-02-27T12:00:00.123

In this example, the 123 is milliseconds.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜