Guardian C Library Calls Reference Manual
time
3-222 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
time
The time function determines the current calendar time, expressed as the number of
seconds that have elapsed since January 1, 1970, Coordinated Universal Time (UTC).
timer
is a pointer. If timer is not NULL, the current calendar time also gets stored in the
variable pointed to by timer.
Return Value
is the current calendar time.
Example
This example uses the time function to obtain the current time in time_t format, then
displays the time.
#include <timeh>
#include <stdioh>
time_t now;
int main(void)
{
now = time(NULL);
printf("%s%ld\n", "now = ", now);
}
#include <timeh>
time_t time(time_t *timer);