When I first added the timestamp function to the code it seemed to work. While finishing the code and testing the site I saw that an error appeared and instead of it saying for example “10 mins ago” it said “-3457 seconds ago”. This meant that the filters for most recent were getting confused to I needed to fix the error.
Example of the error:
I spent a long time trying to fix the code and realised that it started from -3600 seconds which is an hour. I then realised that it could be because the clocks changed a few days after I finished this code. I then found an alternative to “UTC” as the default timezone on the code on the php site. I had tried other timezones such as EST and GMT just as a test but these apparently aren’t readable by the PHP. This seemed to work successfully and now I had an accurate timezone on my timestamp function.
Now the site looks this this: