[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: CFITSIO: fits_write_date




gcc on Solaris 8 just turned your program into a 4648 byte
executable.  The program works just fine.  Output was

   GMT is Thu Apr 12 23:26:10 2001

   local time is Thu Apr 12 16:26:10 2001

My Solaris system is set for "Pacific Time" so the above,
I think is correct.

I suspect the one hour error is in some library.  If you
get the error using MS C++ try using gcc on the same system.
If gcc gives the correctanswer then you've found the problem.

IMO even 4.6K is on the large size for such a simple program.
I can remember compters that had 4K of RAM and did more then
print the date.




> -----Original Message-----
> From: John McKendry [mailto:mckendry@mediaone.net]
> Sent: Thursday, April 12, 2001 3:27 PM
> To: tass@listserv.wwa.com
> Subject: re: CFITSIO: fits_write_date
> 
> 
> "Creager, Robert S" wrote:
> > 
> > Help,
> > 
> > We seem to of run into an issue with CFITSIO, and I wanted 
> someone's take
> > who might of worked with this before.  Basically, when I 
> use the Windows
> > version of CFITSIO (2.037) to write the date 
> (fits_write_date), the time is
> > an hour earlier then the actual windows system time.  Tom 
> has tried with
> > both GMT settings in windows, with apparently no effect.  Thoughts?
> > 
> > Thanks,
> > Rob
> > 
>  I don't have source for 2.037 - currently available is 
> 2.201. In this version,
> fits_write_date() just uses the time returned from the system 
> function gmtime()
> (or from localtime() if gmtime() returns NULL, but that 
> shouldn't happen).
>  If you have a C development tool for Windows you can see 
> what gmtime() is returning
> with this:
> 
> #include <time.h>
> #include <stdio.h>
> 
> int main (int argc, char** argv)
> {
>   struct tm *newtime;
>   long ltime;
> 
>   time( &ltime);
>   newtime = gmtime(&ltime);
>   printf ("GMT is %s\n", asctime(newtime));
> 
>   newtime = localtime (&ltime);
>   printf ("local time is %s\n", asctime(newtime));
> 
>   return 0;
> }
> 
>  The smallest executable Visual C++ can make of this is 
> ~50Kbytes. I don't
> want to open up ftp on this machine for security reasons, but 
> if someone can
> suggest a good public ftp site I can put the executable out 
> there. Not sure
> what it would prove, but at least we would know whether the 
> problem is with
> Windows' gmtime() or somewhere else.
> 
> John
>