time_t is a libc type alias for the whole-second portion of a time value: the number of seconds elapsed since an epoch, commonly the Unix epoch. Its underlying integer type depends on the platform, so code should use the alias rather than assume a fixed-width integer. section 9.4 section 9.7.2
Keep these properties in mind when working with libc time values:
- Treat time_t as the seconds component; suseconds_t represents the fractional component. section 9.7.2
- Expect the representation to vary: libc implementations may use signed or unsigned integer types, and some platforms use a different epoch. section 9.4
- Use the alias when converting application timestamps for operating-system interfaces instead of hard-coding an integer type. section 9.7.2
Putting seconds into timeval
A libc clock-setting operation stores whole seconds in timeval.tv_sec and fractional microseconds in timeval.tv_usec. The application converts its timestamp into the platform’s aliases before calling settimeofday. section 9.7.2
#![allow(non_camel_case_types)]
type time_t = i64;
type suseconds_t = i64;
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
This compact definition shows the alias relationship and how time_t and suseconds_t become the field types of timeval. section 9.7.2

