The spatiotemporally-nonlocal phenomena in heat conduction become significant but challenging for metamaterials with artificial microstructures. However, the microstructure-dependent heat conduction phenomena are captured under the hypothesis of spatiotemporally local equilibrium. To capture the microstructure-dependent heat conduction phenomena, a generalized nonlocal irreversible thermodynamics is proposed by removing both the temporally-local and spatially-local equilibrium hypotheses from the classical irreversible thermodynamics. The generalized nonlocal irreversible thermodynamics has intrinsic length and time parameters and thus can provide a thermodynamics basis for the spatiotemporally-nonlocal law of heat conduction. To remove the temporally-local equilibrium hypothesis, the generalized entropy is assumed to depend not only on the internal energy but also on its first-order and high-order time derivatives. To remove the spatially local equilibrium hypothesis, the thermodynamics flux field in the dissipation function is assumed to relate not only to the thermodynamics force at the reference point but also to the thermodynamics force of the neighboring points. With the developed theoretical framework, the thermodynamics-consistent spatiotemporally-nonlocal models can then be developed for heat transfer problems. Two examples are provided to illustrate the applications of steady-state and transient heat conduction problems.