How can I check the yesterday date without doing one by one validation. I am storing data in session and try to fetch the data if current date is changed, (with date, month and year). I can do this by checking one by one but is their any simple way to do this.
Process is like this :
user open the website (An api call make to the server and get the data and saved that data into localstorage)
If user refresh the website all is working fine, bcoz I can fetch the data from localhost
But from the admin side I add new data, now If user open the website it will get the old data not the new one,
So I am trying to check if 24 hours has been passed then a new API call make to the server and get the fresh data.
It will reduce the api calls in a sinlge daya as well as make the website more faster.