Re: about time conversion [message #8401] |
Sat, 08 March 1997 00:00 |
R. Bauer
Messages: 137 Registered: November 1996
|
Senior Member |
|
|
Paolo alberoni wrote:
>
> I work on unix machine and my data are stored with the UNIX-time ( seconds from
> 1/1/70) and I wan't convert it to a more readble format (like dd-mm-yy hh:mm:ss)
> there is an IDL routine for this ?
>
> thanks
> Pier Paolo
I know that's Ray Sterner wrote a lot of routines to translate times in
several formats. Look at his library
>
> --
> ============================================================ =================
> Pier Paolo Alberoni
> ARPA-Servizio Meteorologico
> Viale Silvani 6
> 40122 Bologna Italy
> Tel: +39 51 284559
> fax: +39 51 284664
> Email: paolo@metgraxp.arpamet.regione.emilia-romagna.it
--
R.Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@kfa-juelich.de
|
|
|
Re: about time conversion [message #8403 is a reply to message #8401] |
Fri, 07 March 1997 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Paolo alberoni <paolo@metgraxp.arpamet.regione.emilia-romagna.it> writes:
> I work on unix machine and my data are stored with the UNIX-time ( seconds from
> 1/1/70) and I wan't convert it to a more readble format (like dd-mm-yy hh:mm:ss)
> there is an IDL routine for this ?
There are a number of IDL routines related to time at URL
http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/time/
ftp://sohoftp.nascom.nasa.gov/solarsoft/gen/idl/time/
There's a description of the software at
http://orpheus.nascom.nasa.gov/cds/swnote/cds_swnote_14.ps
Actually, these routines address the harder problem of converting between TAI
and UTC, with the corrections for leap seconds applied. There is no software
specifically for working with Unix time. However, it's a quite simple matter
to convert from Unix time to a format that it can understand. In fact, the
routine GET_UTC does exactly this to determine the current time. The following
few lines do the trick.
SECONDS = SYSTIME(1)
DAYSECONDS = 24.D0 * 60.D0^2
MJD = LONG(SECONDS/DAYSECONDS)
UTC = {CDS_INT_TIME, $
MJD: 40587L + MJD, $
TIME: ROUND(1000*(SECONDS-MJD*DAYSECONDS))}
This structure can then be passed to UTC2STR to output a string time in a
variety of formats.
Bill Thompson
|
|
|
|