Y2K Compliance

Dates in FITS data files

The original FITS standard for astronomical data files uses the format
dd/mm/yy
for dates used as values for such header keywords as DATE and DATE-OBS. The 2-digit year is assumed to have 1900 added to it to get the actual year of observation. There is thus a problem when the actual year is 2000 or greater.

Coordinate-related dates, such as EPOCH, which is used as the equinox of the coordinate system in the original standard, and EQUINOX, which is coming to be used to designate the date of the equinox of the coordinate system, are usually given as a fraction of a year, such as 2000.0 or 1950.0. This use of traditional astronomical notation will create no new problems in the year 2000.

After some discussion, the world-wide community of FITS users decided in 1997 to use the the ISO 8601 format (full text in PDF) for values of DATE-* keywords. In this standard, the date and time are given as

yyyy-mm-ddThh:mm:ssss
The text of the proposed FITS standard is available.

Dates in WCSTools

WCSTools uses dates in two ways:
  • in conversion between two coordinate types, such as J2000 and B1950 (FK5 and FK4), where the use of the epoch of observation can improve the accuracy of the conversion, and
  • in computation of the positions of stars with known proper motions.

    Internally, 4-digit years have ALWAYS been used, with 1900 added to 2-digit years on input. Nonstandard 4-digit years in date strings (dd/mm/yyyy as well as dd/mm/yy) have always been allowed in WCSTools. Three-digit years also have 1900 added to them, as some old data systems write 100 for the year 2000. As 3-digit years are not otherwise allowed in the old FITS standard, this should be safe.

    Decoding of ISO 8601 dates was added to the date decoding subroutine hgetdate() in late July of 1997; the next version of WCSTools, 1.4, which was released in October 1997, contained the fix. Date decoding is complicated by the fact that there are significant numbers of FITS files around with dates written as dd-mm-yy. WCSTools assumes that format instead of ISO 8601 if dd in the ISO format is greater than 31.

    Changing Date Formats

    In WCSTools version 2.6.11 and later, in sethead, if a date-valued keyword is specified with no =value, the value of that date keywords is changed from the old FITS standard, dd/mm/yy, to the new FITS standard, yyyy-mm-dd. The program is tolerant of variations on the old standard and can handle 4-digit years. Three-digit years have 1900 added to them, as some old data systems still in use write 100 as the year in 2000. Unless the -n command is used, the images in the image list are overwritten, although no change is made to a file if no date keyword is found. Other sethead commands may be used at the same time. In WCSTools version 2.7.0 and later, getdate is a generalized date conversion program which can convert from almost any imagineable date format to any other format.