The time delay experienced by a light ray as it passes through a changing gravitational potential by a nonzero mass distribution along the line of sight is usually referred to as "Shapiro" delay. Shapiro delay has been extensively measured in the solar system and in binary pulsars, enabling stringent tests of general relativity (GR) as well as measurement of neutron star masses. However, Shapiro delay is ubiquitous and experienced by all astrophysical messengers on their way from the source to the Earth. We calculate the "one-way" static Shapiro delay for the first discovered millisecond pulsar PSR B1937+21, by including the contributions from both the dark matter and baryonic matter between this pulsar and the Earth. We find a value of approximately 5 days (of which 4.74 days is from the dark matter and 0.22 from the baryonic matter). We also calculate the modulation of Shapiro delay from the motion of a single dark matter halo, and also evaluate the cumulative effects of the motion of matter distribution on the change in pulsar's period and its derivative. The time-dependent effects are too small to be detected with the current timing noise observed for this pulsar.