The above is caused by calling Date() on the server when the variable is declared, which causes a mismatch between the timestamps by the time it gets to the client. The HTML can only be modified once it gets to the client, so the state must be empty until useEffect() runs.