fix ordering issues for time_t