C time() function
C time() function - Get time
Syntax:
time_t time(time_t *t)
The time() function is used to determine the current calendar time, in seconds.
Parameters:
Name | Description | Required /Optional |
---|---|---|
seconds | Pointer to the storage location for time. | Required |
Return value from time() function
- Upon successful completion, time() shall return the value of time.
- Otherwise, (time_t)-1 shall be returned.
Example: time() function
The following example shows the usage of time() function.
Output:
Tue Dec 20 18:54:38 2022 1671542678 secs since the Epoch
C Programming Code Editor:
Previous C Programming: C strftime()
Next C Programming: C time.h Home
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics