RAD Studio
ContentsIndex
PreviousUpNext
time

Header File 

time.h  

Category 

Time and Date Routines 

Prototype 

time_t time(time_t *timer); 

Description 

Gets time of day. 

time gives the current time, in seconds, elapsed since 00:00:00 GMT, January 1, 1970, and stores that value in the location pointed to by timer, provided that timer is not a NULL pointer. 

Return Value 

time returns the elapsed time in seconds. 

Example  

#include <time.h>
#include <stdio.h>
int main(void)
{
   time_t t;
   t = time(NULL);
   printf("The number of seconds since January 1, 1970 is %ld",t);
   return 0;
}

Portability

POSIX 
Win32 
ANSI C 
ANSI C++ 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!