cygwin b20.1 thinks it's 1970!???

Thomas Langenback ztdl01@centuryinter.net
Sun Jan 31 23:52:00 GMT 1999


I'm real confused about this, and would appreciate any help that could
be offered...

The following code (snipped and pieced together from a much larger
program), when compiled with CYGWIN B18, and later on a Linux box,
produces the expected results.  However, when compiled with B20, it
says:

> The current time is Fri Jan 16 02:31:17 1970


> #include <sys/types.h>
> #include <sys/time.h>
> #include <ctype.h>
> #include <errno.h>
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> #include <stdarg.h>
> #include <time.h>
> 
> 
> int main( int argc, char **argv )
> {
>     time_t		    current_time;
>     char *time;
>     struct timeval now_time;
>     /*
>      * Init time.
>      */
>     gettimeofday( &now_time, NULL );
>     current_time 	= (time_t) now_time.tv_sec;
>     time = ctime(&current_time);
>     time[strlen(time)-1] = '\0';
>     
>     fprintf(stderr, "The current time is %s\n\r", time);
>     return 0;
> }
> 


Any idea why?

Forgive me if the answer is something really obvious... I'm still in the
process of learning C.  This would be the reason I got the CYGWIN
compiler in the first place.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list