<ctime>
or <time.h>
.
Functions | Description |
---|---|
time_t time(time_t *time); | Returns local time by converting time_t using pointer |
char *ctime(const time_t *time); | Returns local time by converting time_t using pointer |
struct tm *localtime(const time_t *time); | Returns to tm structure using pointer to represent local time |
clock_t clock(void) | Returns duration of current running program |
char * asctime(const struct tm * time); | Returns pointer to structure converting the data to day month date hours:minutes:seconds:year\n\0 format |
struct tm * gmtime(const time_t *time); | Returns pointer to structure representing the GMT time |
time_t mktime(struct tm *time); | Returns the exact time in the structure when pointer points it. |
double difftime(time_t time2, time_t time1); | Calculates the differences between time1 and time2 |
size_t strftime(); | Returns formatted date and time |
Field | Type | Meaning | Range |
---|---|---|---|
tm_sec | int | represents seconds of minutes | 0-61 |
tm_min | int | represents minutes of hour | 0-59 |
tm_hour | int | represents hours of day | 0-23 |
tm_mday | int | represents day of month | 1-31 |
tm_mon | int | represents month of year from January | 0-11 |
tm_year | int | represents years since 1900 | |
tm_wday | int | represents days since Sunday | 0-6 |
tm_yday | int | represents days since January 1st | 0-365 |
tm_isdst | int | represents hours saving day time |
Syntax | Description |
---|---|
data_type sin(number); | Returns the sine angle to the given number |
data_type cos(number); | Returns the cosine angle to the given number |
data_type tan(number); | Returns the tangent angle to the given number |
data_type log(number); | Returns the logarithm to the given number |
data_type pow(number1, number2); | The first is a base number and the second is the power |
data_type hypo(number1, number2); | Returns the length of the hypotenuse in which both numbers represents the sides of right angled triangle |
data_type sqrt(number); | Returns the square root of the given number |
data_type abs(number); | Returns the absolute value to the given integer number |
data_type fabs(number); | Returns the absolute value of any given decimal number |
data_type floor(number); | Checks the integer which is less than or equal to the argument passed to it |