In the present study, P-T phase diagrams of ZrO2 and HfO2 for a wide pressure range of 0-150 GPa at 0-2500 K were calculated for the first time using density functional theory with the method of lattice dynamics within the quasi-harmonic approximation. We calculated P-T conditions for a full sequence of high-pressure transformations, P2(1)/c -> Pbca -> Pnma -> P (6) over bar 2m, for both compounds. At low temperatures, these transformations for ZrO2 are obtained at 7.6 GPa (P2(1)/c -> Pbca), 13.4 GPa (Pbca - Pnma), and 143 GPa (Pnma -> P (6) over bar 2m), while for HfO2 similar polymorphic transitions are obtained at 9 GPa (P21/ c -> Pbca), 16 GPa (Pbca -> Pnma), and 126 GPa (Pnma -> P (6) over bar 2m), correspondingly. At high temperatures, for both ZrO2 and HfO2 the P2(1)/c and Pbca structures transform into the P4(2)/nmc modification. In addition, the thermal conductivity and elastic properties of the ZrO2 and HfO2 polymorphs were calculated and compared with the available experimental and theoretical data.