Fraction of a second representation with ISO 8601: 2004

The following is the definition of IS0 8601: 2004. It states that a fraction of a second can be represented by one to six digits.

Can all 6 digits be used to represent a fraction of a second?
Are the following representations correct if I use 6 digits to represent a fraction of a second?

1ms - 001000 10ms
- 010000
100ms - 100000

{Extended time format} (32 bytes)
YYYY-MM-DDThh: mm: ss.sTZD
YYYY = year 0000 to 9999
MM = month 01 to 12
DD = Day 01 to 31
T = special separator T
hh = hour 00 to 23
mm = minute 00 to 59
ss = Second 00 to 59
s = one to six digits representing a fraction of a second TZD = time zone designation
(TZD is denoted by '+ hh: mm,' -hh: mm or'Z)

+3


source to share


1 answer


ISO 8601: 2004 does not specify the number of decimal places.

4.2.2.4 Decimal representations

The parties to the exchange, depending on the application, agree on the number of digits in decimal fractions. The format should be [hhmmss, ss], [hhmm, mm] or [hh, hh] as needed (hour minute second, hour minute and hour respectively), with as many digits as needed after the decimal point. The decimal fraction must have at least one digit.



Yes, your idea is correct if you use 6 digits for the decimal.

1ms   -- 001000
10ms  -- 010000
100ms -- 100000
1Ξs   -- 000001

      

+7


source







All Articles