What @deceze said is a good approach. Instead of updating the counter value every 10 seconds, just store the startDateTime somewhere (e.g., in .env or config.json). Then use this snippet:
<script>
const startDateTime = new Date('2025-11-10T00:00:00Z'); // example start time
const now = new Date();
const diffInSeconds = Math.floor((now - startDateTime) / 1000);
const counterValue = Math.floor(diffInSeconds / 10);
console.log(counterValue);
</script>