Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- 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

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

    time() returns the number of seconds that have elapsed since 00:00:00
    Greenwich mean time, January 1, 1970.  That 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>

         long 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