If this is the root of your problem
But instead of replacing the current time of day it prints a new time of day every second.
then you can't make the Date object responsive, because
JavaScript Date objects represent a single moment in time in a platform-independent format.
If you don't wish to create a new object every second, you can register a dedicated Web worker that calls performance.now() every second, but this is more demanding on system resources than simply creating the Date object, which just copies the actual system clock (thus not creating a separate process for measuring the time). tl;dr: just create a new Date object every second as you do.
The root of your document.write()
issue stems from this:
Because document.write() writes to the document stream, calling document.write() on a closed (loaded) document [in setInterval in your case] automatically calls document.open(), which will clear the document.
To update part of your page, you usually set innerHTML of some element as @Pranav suggests.
document.write
does just add stuff to the document, so you will get multiple lines of output. You want to replace the output instead of keep adding to it. – Signature