Systime function works! [message #1993] |
Thu, 14 April 1994 07:19 |
andy
Messages: 31 Registered: November 1993
|
Member |
|
|
Hi!
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.
I then compared my result to the output from IDL (taken at the same
time and on the same computer).
> date '+DAY:%j TIME:%T DATE:%D'
DAY:104 TIME:09:28:42 DATE:04/14/94
24 complete years have passed since 1/1/70 (1970-1993), 18 of these had
365 days, and 6 had 366 days. How many seconds is that?
18 years * 365 days * 86400 sec/day = 567648000 seconds
6 years * 366 days * 86400 sec/day = 189734400 seconds
------------------
757382400 seconds STEP #1
Today is day 104 of year 1994, time is 9:28:42. 103 complete days have passed.
103 days * 86400 seconds/day = 8899200 seconds
9 hours * 3600 seconds/hr = 32400 seconds
28 minutes * 60 sec/min = 1680 seconds
42 seconds = 42 seconds
------------------
8933322 seconds STEP #2
Time since Jan. 1, 1970 = STEP#1 + STEP#2 = 766315722 seconds.
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.
Andy
--
,__o Andrew F. Loughe (Code 971)
-\_<, NASA Goddard Space Flight Center phone: (301) 286-5899
(*)/'(*) Greenbelt, MD 20771 email: andy.loughe@gsfc.nasa.gov
|
|
|