check if a timestamp is older than one hour

this will check if the timestamp string is less or more than one hour old.

PHP

$timestamp = strtotime("2020-05-04 13:24:32");
if ($timestamp >= strtotime('-1 hours')) {
    // dont run
    echo "🐛 <b>Dont</b> Run Import";
  } else {
    // run import
    echo "🐛 Run Import";
  }

Other Items in php
Page Views

This page has been viewed 152 times.

Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹

Random Quote
Our brains are wired to find things we are looking for - if your always cynical or waiting for things to go wrong, then your life will reflect that. On the other hand, having a positive outlook on life will bring you joy and provide you with inspiration when you least expect it ☀️🍉🌴
Unknown