DATE-OBS='31/12/99'

Preben Grosbol pgrosbol at serv2.hq.eso.org
Thu Jul 4 04:34:28 EDT 1996


William Pence wrote:

>I would go further than Rob, however, and suggest that we extend the
>definition of DATE-OBS keyword to allow the full ISO 8601 data/time format,
>in addition to the current dd/mm/yy format.  Thus all the following
>examples would be legal:
>
>     DATE-OBS= '24/06/98' 
>     DATE-OBS= '2010-02-13T13:53:10.3Z' 
>     DATE-OBS= '2010-02-13'

 It seems clear that a new date format should use the ISO 8601 definition.
However, I am still concerned with old reader getting a new format in
the date value string. As a simple example here is a FORTRAN-77
program 

      PROGRAM DATEOBS
C
      INTEGER       IDD, IMM, IYY
      CHARACTER*80  CARD1, CARD2, CARD3
C
      CARD1 = 'DATE-OBS= ''24/06/98''                / FITS standard'
      CARD2 = 'DATE-OBS= ''2010-02-13''              / ISO date'
      CARD3 = 'DATE-OBS= ''2010-02-13T13:53:10.3Z''  / ISO date/time'
C
      WRITE(6,1000) CARD1
 1000 FORMAT(A72)
      READ(CARD1,500) IDD,IMM,IYY
 500  FORMAT(11X,I2,X,I2,X,I2)
      WRITE(6,1001) IYY,IMM,IDD
 1001 FORMAT('Year ',I2,', Month: ',I2,', Day: ',I2)
C
      WRITE(6,1000) CARD2
      READ(CARD2,500) IDD,IMM,IYY
      WRITE(6,1001) IYY,IMM,IDD
C
      WRITE(6,1000) CARD3
      READ(CARD3,500) IDD,IMM,IYY
      WRITE(6,1001) IYY,IMM,IDD
C
      END

which on a SunOS gives:

 ns2{~/tmp}223: f77 dateobs.for -o dateobs
 dateobs.for:
  MAIN dateobs:
 ns2{~/tmp}224: dateobs
 DATE-OBS= '24/06/98'                / FITS standard
 Year 98, Month:  6, Day: 24
 DATE-OBS= '2010-02-13'              / ISO date
 Year -2, Month:  0, Day: 20
 DATE-OBS= '2010-02-13T13:53:10.3Z'  / ISO date/time
 Year -2, Month:  0, Day: 20

 Although most FITS readers would be more clever there may still be
a few 'old' trivial programs left.

 It is clear that all major organizations will be able to implement
the change but there are also smaller sites.

Preben Grosbol




More information about the fitsbits mailing list