Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <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 in number of seconds since 00:00:00 Greenwich
    mean time, January 1, 1970.  The value is stored in a location
    pointed to by 'timeptr'.  If 'timeptr' is NULL, the return value is
    not stored.

       Returns:     The time elapsed in seconds.  There is no error
                    return.

   -------------------------------- 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() gmtime() localtime()

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