Re: equivalent of c function: gmtime [message #2319] |
Thu, 09 June 1994 06:24  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
fitz@nextone.lanl.gov writes:
> I understand that systime(arg) will return either the number of seconds
> elapsed from Jan 1, 1970 or a string with the current date and time. Does
> anyone know of procedures that are the equivalent of the C functions: gmtime,
> asctime, difftime, etc? In particular, given the seconds from Jan 1, 1970, is
> there a way to get a string giving the day, date, and time?
I have a number of time handling routines that will do the job for you. I've
asked Wayne Landsman to put it on the anonymous ftp server
idlastro.gsfc.nasa.gov under contrib/thompson/time. Unfortunately, what's
there now is tremendously out of date, but it should be updated soon. (In
particular, what is missing is the routine that calls SYSTIME and interprets
the seconds as a date and time. I could also mail it to you as a uuencoded tar
file if you don't want to wait.
One thing that one should be aware of. On Unix systems the string time
returned by SYSTIME() in IDL is a local time, whereas the numerical time is
related to UTC (aka GMT). I think this is also true on VMS systems. However,
on VMS and (I think) MacIntosh computers, it seems that both times are local.
Bill Thompson
William.T.Thompson.1@gsfc.nasa.gov
|
|
|