JSFiddle - React, Tailwind, and code Playground

by jarosciak

JavaScript

function calculateAMP() {
  // Calculate the current number of days since the UNIX epoch
  var currentDaysSinceEpoch = Math.floor((Date.now()/1000 - 1665250163)/86400);
  // Calculate the value of AMP
  var ampValue = 3000 - currentDaysSinceEpoch;
  
  // Output the result to the console
  console.log("The value of AMP is: " + ampValue);
}

// Call the calculateAMP function
calculateAMP();