Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-123
mktime
mktime
The mktime function converts the broken down local time in the structure pointed to by
timeptr into the corresponding calendar time.
timeptr
points to the structure that contains the broken-down time, expressed as local time.
This structure is of type struct tm.
Return Value
is the specified calendar time encoded as a value of type time_t. If the calendar time
cannot be represented, the function returns the value (time_t)-1.
Usage Guidelines
The structure pointed to by timeptr is of type struct tm. The structure type struct tm
is defined in the header timeh and has the following members:
struct tm{
int tm_sec; /* seconds after the minute: [0, 61]*/
int tm_min; /* minutes after the hour: [0, 59] */
int tm_hour; /* hours since midnight: [0, 23] */
int tm_mday; /* day of the month: [1, 31] */
int tm_mon; /* months since January: [0, 11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday; [0, 6] */
int tm_yday; /* days since January 1: [0, 365] */
int tm_isdst; /* Daylight Savings Time flag */
};
Note that the flag tm_isdst is positive if Daylight Savings Time is in effect, zero if it
is not, and negative if the information is not available.
For the purpose of the computation, the tm_wday and tm_yday members of the
structure are disregarded. On successful completion of the computation, the values
of the tm_wday and tm_yday members of the structure are set appropriately, and the
other members of the structure might be overwritten with an equivalent set of values
in which each member lies within its normal range. The final value of tm_mday is
not set until tm_mon and tm_year are determined.
You get Wed Dec 31 23:59:59 1969 for the date if you enter a value out of range for:
tm_sec, tm_min, tm_hour, tm_mday, tm_mon, or tm_year.
#include <time.h>
time_t mktime(struct tm *timeptr);