  The amplitude of the pseudoscalar (axion) or scalar field fluctuates on a
time scale of order of million field oscillation periods which is a typical
coherence time in the virialized axion galactic dark matter halo model. This
causes fluctuations of frequencies of atomic clocks on the same time scale. We
show that this effect may be employed to search for the axion and scalar field
dark matter with atomic and nuclear clocks. We re-purpose the results of the
atomic clocks experiments comparing the variations of frequencies of hyperfine
transitions in Rb and Cs atoms as well as in hydrogen atom vs cavity frequency
fluctuations, and extract new limits on the axion coupling constant $f_a$ for
masses in the range $2.4\times 10^{-17}\text{ eV}\lesssim m \lesssim
10^{-13}\text{ eV}$. We also show that similar energy shifts arise in the
second-order perturbation theory with linear in the pseudoscalar field
interaction. These shifts may be potentially measured with nuclear clocks based
on the low-energy transition in $^{229}$Th nucleus. We propose a procedure
which could, in principle, help determine the axion mass if the axion dark
matter signal is present in experimental data sets.
