Re: Systime function works! [message #1984] |
Fri, 15 April 1994 15:16 |
sterner
Messages: 106 Registered: February 1991
|
Senior Member |
|
|
In comp.lang.idl-pvwave Andrew F. Loughe writes:
. . .
> Does the systime function in IDL *REALLY* return the number of seconds
> since January 1, 1970? I needed to know, so I though I would compute
> the quantity myself using output from the Unix command shown below.
<computation removed>
> Does this all seem straightforward? I thought so, but IDL returns:
> IDL> print, systime(1), format='(e15.8)'
> 7.66330122e+08
> Why are these numbers different by 14400 seconds (exactly 4.0 hours)!?
> The IDL function must use the time at Greenwich England, so systime works!
> I thought I'd pass that along to anyone else who is interested.
When I discovered this some time ago I thought it was an unneeded
complication, but have now decided that it is an advantage. I use
the time base difference between systime() and systime(1) to find
the local time zone, or more accurately, the current time difference
from Greenwich. The JHU/APL IDL library routine gmt_offsec returns
the time difference in seconds. It's not a standalone routine so I
won't post it. It assumes your local computer clock is right (to
within about 10 or 15 minutes anyway).
Ray Sterner sterner@tesla.jhuapl.edu
Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
|
|
|