  Pair density waves, identified by Cooper pairs with finite center-of-mass
momentum, have recently been observed in copper oxide based high T$_\textrm{c}$
superconductors (cuprates). A charge density modulation or wave is also
ubiquitously found in underdoped cuprates. Within a general mean-field one-band
model we show that the coexistence of charge density waves and uniform
superconductivity in $d$-wave superconductors like cuprates, generates an
odd-frequency spin-singlet pair density wave, in addition to the even-frequency
counterparts. The strength of the induced odd-frequency pair density wave
depends on the modulation wave vector of the charge density wave, with the
odd-frequency pair density waves even becoming comparable to the even-frequency
ones in parts of the Brillouin zone. We show that a change in the modulation
wave vector of the charge density wave from bi-axial to uni-axial, can enhance
the odd-frequency component of the pair density waves. Such a coexistence of
superconductivity and uni-axial charge density wave has already been
experimentally verified at high magnetic fields in underdoped cuprates. We
further discuss the possibility of an odd-frequency spin-triplet pair density
wave generated in the coexistence regime of superconductivity and spin density
waves, applicable to the iron-based superconductors. Our work thus presents a
route to bulk odd-frequency superconductivity in high T$_c$ superconductors.
