Pointer to a `time_t` object where the current time will be stored. If this is `NULL`, the current time is not stored but is still returned by the function.
Read more about parameters of time in parameters section
The timefunction in C language Gets the current calendar time.
The time function returns the current calendar time as a time_t value, which represents the number of seconds elapsed since the Epoch (00:00:00 UTC, January 1, 1970). If the argument is not NULL, the return value is also stored in the location pointed to by the argument.
The timefunction takes 1
parameter:
•
time_t * `timer`: Pointer to a `time_t` object where the current time will be stored. If this is `NULL`, the current time is not stored but is still returned by the function.
Returns the current time as the number of seconds since the epoch (00:00:00 UTC, January 1, 1970). If `timer` is not `NULL`, the result is also stored in the object pointed to by `timer`. Returns `(time_t)(-1)` if the current time is not available.
The time function return value :
Returns the current calendar time as a time_t value, or -1 if the time is not available
Output
This example gets the current time and prints it as a long integer.