  The discovery of gravitational waves (GWs) opens a new window for exploring
the physics of the early universe. Identifying the source of GWs and their
spectra today turn out to be the important tasks so as to assist the
experimental detection of stochastic GWs. In this paper, we investigate the
oscillations of the ultralight dark photon (ULDP) into GWs in the dark halo.
Assuming dark matter is composed of the ULDP and there are primordial dark
magnetic fields (PDMFs) arising from the axion inflation and/or the dark phase
transition, then the ULDP can oscillate into the GW when it passes through an
environment of PDMFs. We derive the local energy density of GWs in the galaxy
cluster induced by the instaneous oscillation of ULDP in the PDMFs. These
stochastic local GWs exhibit a pulse-like spectrum, with frequency depending on
the mass of the ULDP, and can be detected in Pulsar Timing Arrays (PTAs) or
future space-based interferometers. We also find that the low-frequency GW
signal observed by the NANOGrav collaboration and other PTA experiments can be
explained by the oscillation of the ULDP in the PDMFs in the early universe.
