localtime_r

Function localtime_r 

Source
pub unsafe extern "C" fn localtime_r(
    timep: *const TimeT,
    tmp: *mut Tm,
) -> *mut Tm
Expand description

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

Rust interface for the C function:

struct tm *localtime_r(time_t const *restrict, struct tm *restrict);

The localtime_r function corrects for the time zone and any time zone adjustments (such as Daylight Saving Time in the United States). The storage for the returned Tm should be passed in as the 2nd argument. If it encounters an error, it will return a NULL and set errno (see std::io::Error::last_os_error). The pointer returned in Tm::tm_zone will only be valid until the next tzet() call.