79815279

Date: 2025-11-10 06:50:47
Score: 1.5
Natty:
Report link

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>
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @deceze
  • Starts with a question (0.5): What
  • Low reputation (0.5):
Posted by: Jasjeet Singh