JSFiddle - React, Tailwind, and code Playground

by Julian Garcia Castillo

JavaScript

const now = new Date()
const yesterday = new Date(now)
yesterday.setDate(yesterday.getDate() - 1)

let lastTimePlayed = yesterday.getTime()
const t12hr = 60 * 60 * 12 * 1000 ;
var compareDatesBoolean = (now - lastTimePlayed) > t12hr;

console.log(now)

console.log(compareDatesBoolean)