[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
New Address!   --   Neue Adresse!
[Uni logo]


GET_DATE Source code in get_date.pro

GET_DATE

Name
       GET_DATE
Purpose
       Return the (current) UTC date in CCYY-MM-DD format for FITS headers
Explanation
       This is the format required by the DATE and DATE-OBS keywords in a
       FITS header.
Calling Sequence
       GET_DATE, FITS_date, [ in_date, /OLD, /TIMETAG, LOCAL_DIFF=]
Optional Input Parameters
       in_date - string (scalar or vector) containing dates in IDL
            systime() format (e.g. 'Tue Sep 25 14:56:14 2001')
Output Parameters
       FITS_date = A scalar character string giving the current date.    Actual
               appearance of dte depends on which keywords are supplied.
       No Keywords supplied - dte is a 10 character string with the format
               CCYY-MM-DD where  represents a calendar year,  the
               ordinal number of a calendar month within the calendar year,
               and 
the ordinal number of a day within the calendar month. /TIMETAG set - dte is a 19 character string with the format CCYY-MM-DDThh:mm:ss where represents the hour in the day, the minutes, the seconds, and the literal 'T' the ISO 8601 time designator /OLD set - dte is an 8 character string in DD/MM/YY format
Keyword Parameters
       /TIMETAG - Specify the time to the nearest second in the DATE format
       /OLD - Return the DATE format formerly (pre-1997) recommended for FITS
               Note that this format is now deprecated because it uses only
               a 2 digit representation of the year.
       LOCAL_DIFF - numeric scalar giving the difference between local time
               and Greenwich Mean Time (GMT) in hours.   This keyword is only
               needed for non-Unix users prior to V5.4.  Unix users should not
               use this keyword because under Unix (or since V5.4 with any OS),
               SYSTIME(1) returns the UTC (=GMT) time directly.
               Users on other machines must either supply a LOCAL_DIFF keyword,
               or use the TIME_CONV environment variable discussed below.
               For example, a user on U.S. Eastern Standard Time should set
               LOCAL_DIFF = -5
Example
       Add the current date to the DATE keyword in a FITS header,h
       IDL> GET_DATE,dte
       IDL> sxaddpar, h, 'DATE', dte, 'Date header was created'
Environment Variable
       An alternate method of inputing the difference between local and GMT
       time for non-Unix machines is to specify this information in a file
       named local_diff.dat in a directory specified with the environment
       variable TIME_CONV.       For example, a user in EST should write -5
       on this first (and only) line of this file.
Note
       (1) A discussion of the DATExxx syntax in FITS headers can be found in
       http://www.cv.nrao.edu/fits/documents/standards/year2000.txt
       (2) Those who wish to use need further flexibility in their date
       formats (e.g. to use TAI time) should look at Bill Thompson's time
       routines in http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/time
Procedures Used
       DAYCNV - Convert Julian date to Gregorian calendar date
Revision History
       Written      W. Landsman          March 1991
       Major rewrite to write new DATExxx syntax  W. Landsman  August 1997
       Converted to IDL V5.0   W. Landsman   September 1997
       Work after year 2000 even with /OLD keyword W. Landsman January 2000
       Don't need to worry about TIME_DIFF since V5.4 W. Landsman July 2001

Last modified by pro2html on 2002 September 06 at 03:22 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically