When time traveling in Star Trek, the ship's clock always seems to show the correct time that they have traveled to.
How do ship & crew determine what the exact date is, prior to the invention of time beacons?
A pulsar's rate of spin is not constant; it slows down over time as electromagnetic power is emitted. If you can calculate your position by triangulating several known pulsars (with adjusted spin rates), you could also use their adjusted spin rates (and a little algebra) to position yourself in sidereal time. Their current position in the galaxy (having moved in a predictable path) would be another clue.
While the slowing of the spin as the pulsar loses angular momentum is a very slow process, 20th century nuclear clocks were able to measure it. If you were instantly transported to sometime in the future, the progressively decayed spin rate of one or more pulsars should be able to pinpoint you in time; at least until you receive a Starfleet beacon's signal. By the same token, one or more known pulsars are going to have a faster spin rate in the past and theoretically, one or two of the newer ones may not even exist as pulsars yet.
Your premise doesn't seem to be true in general (can you point to examples where this was the case?)--looking at the transcript of Star Trek: First Contact, when they traveled back to 2063 Data was initially only able to pin the date down fairly roughly using "astrometrics" (which refers to the mapping of stars and other bodies, perhaps they were using the very subtle proper motion of the stars over time), and then narrowing it down a little more based on evidence of the recent nuclear war:
DATA: According to our astrometric readings we're in the mid twenty-first century. From the radioactive isotopes in the atmosphere I would estimate we have arrived approximately ten years after the Third World War.
Though in the Voyager episode "Future's End", they were able to pin down the date much more precisely, and this was again explained in terms of "astrometric readings":
JANEWAY: The question isn't where we are, it's when we are. Mister Kim.
KIM: According to astrometric readings the year is 1996.
As @Anthony X said in a comment, there was an episode of the original series, "The Naked Time", where they realized they were traveling back in time because they saw their "chronometer" running backwards, indicating some more precise way of inferring their "position" in time. I doubt the writers thought specifically about how it worked, but since this was only a short trip and in a location that could have been in or near Federation space, perhaps we could imagine the chronometer was keeping track of the exact time by means of a Federation-wide system that relied on time signals from beacons emitting subspace signals, akin to the time signals emitted by GPS satellites.
As it turns out, something like this was established to exist in the TNG episode "Cause and Effect", where the Enterprise was caught in a time loop, and once they escaped, they used the signal from a Federation "time base beacon" to figure out the current time:
PICARD: Mister Worf, end Red alert. And try to access a Federation time base beacon. Let's see if we can find out how long we've been in this causality loop.
WORF: Time base confirms our chronometers are off by seventeen point four days.
The Star Trek: The Next Generation Technical Manual, which is not quite canon but was written by the show's technical advisors Michael Okuda and Rick Sternbach (and was an expanded version of a document that served as a guide to the writers), includes a table of "Navigational reference aids" on p. 45 which also refers to "Fed Timebase Beacons". And this page also mentions that Starfleet has a "central galactic condition database" which each ship regularly updates with their latest astronomical findings, and that "Most of the information in the database concerns the present condition of an object, with 'present' defined as real clock time measured at Starfleet Headquarters, San Francisco, Earth." Similarly, as discussed in this pdf, the calculations needed for the GPS system are based on assigning all events position and time coordinates in a single "Earth-Centered, Earth-Fixed Coordinate System".
Another TOS episode to consider is "Tomorrow is Yesterday", where the Enterprise was dragged towards a "black star of high gravitational attraction" and their efforts to escape its gravity threw them back in time to the 1960s. They originally inferred the date when they heard a radio broadcast talking about the first moon shot, but Spock then said he would soon be able to get the exact time:
SPOCK: Whiplash propelled us into a time warp, Captain. Backward. Exact chronometer readings in a few moments.
This seems like a bit of an inconsistency in the portrayal of technology in the TOS vs. the TNG era, although if we really want to rationalize it perhaps we could imagine that Spock was just planning to correlate the radio signals they were receiving with records of 1960s radio and television broadcasts stored in the ship's computers.
The one word answer is "Astrometrics".
The longer answer has to do with positions of planets around the Sun. The outer planets have orbital periods of 11.8, 29.4, 84, and 164.8 years. All you have to do is look at their positions in their orbits. Neptune, with its orbital period of 164.8 years, won't be in a similar position in its orbit for a long time. Then when you also add in Jupiter, Saturn, and Uranus, you can calculate the current year to within a few days for thousands of years into the future.
I also agree with astrometrics.
If a starship makes a jump through time and space the first thing to do is to find it's position in the universe as a whole. If it hasn't left it's galaxy the positions of quasers billions of light years away will be the same. Then search for closer objects such as the nearest and brightest galaxies and the supermassive black holes in their centers to narrow down your position within the Milky Way Galaxy.
Then search for globular star clusters tens of thousands of light years away. Finding the apparent angles between just a few of them should narrow down your position to within a few light years. Then compare the spectra and apparent angles to the nearest stars you detect to those in your database which should be in this region.
Since Star Trek time travel almost always ends up in a solar system, this method will identify the solar system the starship is in.
Each solar system will have a number of planets and most planets will also have moons that orbit them at different rates, and most solar systems might have thousands of asteroids that could be located. If you detect a few tens of objects in a solar system, their relative positions should be unique within the billions of years of solar system history, and if your new time is within a million years in the past or future your computers should be able to calculate the exact date of that unique alignment of objects.
Most Star Trek time travel happens within Earth's solar system and other well known solar systems, and most Star Trek time travel only goes tens or hundreds or thousands of Earth years into the past or future. So using astrometrics to find their exact date down to the second would be easy enough.
References to using atmospheric pollution or residual radioactivity to find the rough date in Star Trek IV: The Voyage Home or Star Trek: First Contact no doubt referred to getting a preliminary rough figure while the astrometric computers were running their calculations to get precise dates and times.
Sometimes the ship's computers might be able to find the date from the time signals of pre-Federation navigation beacons.