Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>time() get current system time as long integer</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 time()                  Get Current System Time as Long Integer

 #include   <time.h>                     Required for declarations only

 time_t time(timeptr);
 time_t *timeptr;                        Storage location for time

    time() returns the time as the number of seconds since 00:00:00
    Greenwich mean time, January 1, 1970 and stores that value in a
    location pointed to by 'timeptr'.  If 'timeptr' is NULL, the return
    value is not stored.

    Returns:    The elapsed time, in seconds; no error return.

 Portability:   Not supported by ANSI standard.

   -------------------------------- Example ---------------------------------

    The following statements get and print the elapsed time in seconds.

           #include <time.h>
           #include <stdio.h>

           time_t elapstime;

           main()
           {
               time(&elapstime);
               printf("Number of seconds since 1-1-70: %ld \n",elapstime);
           }


See Also: asctime() ftime() gmtime() localtime() utime()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson