ISO 8601 and STC

Norman Gray norman at astro.gla.ac.uk
Tue Nov 30 11:13:08 PST 2004


Greetings,

At the Pune IVOA meeting, I promised (I've just discovered!) to look at 
ISO 8601, and send a note here on what it can do, and what its 
limitations are.  ISO 8601 rather long-windedly titles itself `Data 
elements and interchange formats -- Information interchange -- 
Representation of dates and times'.

There was also a brief mention of 8601 in another VO-ish thread 
recently (I thought it was in sci.astro.fits, but I wasn't able to find 
it again), which raised the question of whether it could cope with BCE 
dates.

The basic 8601 date and time is `ccyymmddThhmmss' or 
`ccyy-mm-ddThh:mm:ss'.  It's described in helpful detail at 
<http://www.cl.cam.ac.uk/~mgk25/iso-time.html>.

Features not mentioned there include:

   * Dates are explicitly the Gregorian calendar; proleptic dates are 
OK; BCE dates are not.  The last point isn't explicit, but implied, 
since a leading minus/hyphen indicates an omitted component: `-1001' 
would be month 01 in year 10 of the current century, and '-100' would 
be day 100 in the current year.  I can't see how either of the latter 
notations is particularly useful, but that's just tough.

   * Times are explicitly UTC only, and can be arbitrarily precise, 
since any of hours, minutes or seconds may be given a decimal part 
(using either a period or a comma as the decimal separator).

   * Both 00:00 and 24:00 are midnight, at either end of the day.

   * The standard gives the range of minutes and seconds as 00-59, thus 
making leap seconds formally non-conformant.  Markus Kuhn's time page, 
referred to above, suggests that a leap second is legal, but this 
doesn't seem to be supported by the standard.

   * You can refer to week numbers: `2004W012' is the twelfth week of 
2004.  There are no other divisions of the year defined -- specifically 
no quarters, as was hypothesised in Pune.

   * However there is provision for specifying time periods, either as 
the interval between two dates, or as a date plus a duration.  Thus 
`20040401/P3M' represents the period between 20040401 and a date 3 
months after it.  I think this could also be expressed as 
20040401/P0003 or even 20040401/P--03 (plus various other short forms 
of the initial date), though this is defined rather in passing, and not 
terribly clearly.

So the fact you can't specify a timescale, and it can't (depending on 
how fussy you're being) specify leap seconds, make it not ideal for 
astronomical use.  However it's good enough for most applications.  
Those areas where it falls down -- roughly, high-precision work and 
archaeoastronomy -- would probably want/need to use JD or MJD anyway.

Hope this helps,

Norman


-- 
----------------------------------------------------------------------
Norman Gray  :  Physics & Astronomy, Glasgow University, UK
http://www.astro.gla.ac.uk/users/norman/  :  www.starlink.ac.uk



More information about the dm mailing list