Alex Lord
asked on
How to tell if unix timestamp is he 24 hours window of current timestamp,
$created = date('d-m-Y',$setupCampaigns['TIMESTAMP']);
if($setupCampaigns['TIMESTAMP'] < time() + 86400){
$new = "<div class='new-eng-alert has-tooltip' data-original-title='null'>1</div>";
} else {
$new = "";
}
how can i tell if this current timestamp is within the 24 hours old from the current timestamp,
if yes display new else dont.
for example if timestamp is 2 hours old from current show, if it is 25 hours dont show.
Hi,
Also make sure you set the default timestamps on your PHP page https://php.net/manual/en/function.time.php
for example
otherwise you won't have the correct calculation.
Paid attention to the DB timestamps too as the DB maybe set for another timezone..
You can check that using PHPMyAdmin.
if this is different and your are using Timestamp field you will need to set the timezone in your DB connection script using an offset
something like this $offset refer to a specific calculation ...
Also make sure you set the default timestamps on your PHP page https://php.net/manual/en/function.time.php
for example
date_default_timezone_set("UTC");
otherwise you won't have the correct calculation.
Paid attention to the DB timestamps too as the DB maybe set for another timezone..
You can check that using PHPMyAdmin.
if this is different and your are using Timestamp field you will need to set the timezone in your DB connection script using an offset
something like this $offset refer to a specific calculation ...
$db->exec("SET time_zone='$offset';");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window