avoid truncating time values when long is smaller than time_t