The general kind of instrument you want is the https://en.wikipedia.org/wiki/Transit_instrument -- if you can measure the transit of a star to 1 arcsecond, that's better than 1 second/day. That article says there are transit instruments that work down to .01 arcsecond.
Unless you have to go a very long time just counting days (enough for a half a leap second to accumulate), it seems pretty clear you could get the correct UTC second.
You mention computer glitches; there also exist non-transistorized clocks that are accurate to much more than 1s/day. In fact, the Wikipedia article about the Elgin Observatory talks about how use of a transit instrument to discipline a mechanical clock was accurate to .01s https://en.wikipedia.org/wiki/Elgin_National_Watch_Company_O... -- though I doubt such a system is in continuous use today.
Just checked out https://www.nist.gov/pml/time-and-frequency-division/time-re...
I didn't understand everything, but it looks like they have a fleet of atomic clocks for UTC and are resilient to one of the clocks failing. I guess it is possible that if all of those clocks go down, the world loses track of time. I wouldn't want to be responsible for that cluster :)
If you have two databases running on two different computers, there's no guarantee their timestamps are in sync relative to each other or relative to a particular atomic clock's epoch. Is it within a second? Probably, on a modern operating system. Same millisecond? Very unlikely.