comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: about time conversion
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: about time conversion [message #8401] Sat, 08 March 1997 00:00
R. Bauer is currently offline  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 Go to previous message
thompson is currently offline  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
Re: about time conversion [message #8434 is a reply to message #8403] Tue, 04 March 1997 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
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 ?

http://fermi.jhuapl.edu/s1r/idl/s1rlib/time/time.html

is bound to prove useful in this respect.

Cheers,
Liam.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: pickfile(), but with multiple files?
Next Topic: pickfile(), but with multiple files?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:36:22 PDT 2025

Total time taken to generate the page: 0.00544 seconds