mktime

Function mktime 

Source
pub unsafe extern "C" fn mktime(tmp: *const Tm) -> TimeT
Expand description

Convert local time Tm to system time using globally configured time zone.

Rust interface for the C function:

time_t mktime(struct tm *);

The mktime function converts the broken-down time, expressed as local time, in the structure pointed to by tm into a calendar time value with the same encoding as that of the values returned by the time function. The original values of the tm_wday and tm_yday components of the structure are ignored, and the original values of the other components are not restricted to their normal ranges. (A positive or zero value for tm_isdst causes mktime to presume initially that daylight saving time respectively, is or is not in effect for the specified time.

A negative value for tm_isdst causes the mktime function to attempt to divine whether daylight saving time is in effect for the specified time; in this case it does not use a consistent rule and may give a different answer when later presented with the same argument.) On successful completion, the values of the tm_wday and tm_yday components of the structure are set appropriately, and the other components are set to represent the specified calendar time, but with their values forced to their normal ranges; the final value of tm_mday is not set until tm_mon and tm_year are determined. The mktime function returns the specified calendar time; If the calendar time cannot be represented, it returns -1.