Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html5 time element question

Tags:

html

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 give me an example?

like image 485
HELP Avatar asked Sep 26 '26 17:09

HELP


1 Answers

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.

like image 77
Karl Nicoll Avatar answered Sep 28 '26 07:09

Karl Nicoll



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!