This is really strange. I have two time values.
First time:
$t1 = 1311165885;
Second time (which is bigger than the first time):
$t2 = 1312049530;
I am going to subtract the times like this:
$diff = $t2-$t1;
When I do an echo $diff this is coming out:
echo 'Time_diff: ' . $diff;
Time_diff: -1311163874
The actual result should be 883645. What is wrong?
Thanks in advance!
Craphunter
Then here is my code:
<?php
$current_time = DataConverter::makeDatetime();
foreach ($order as $list) {
echo '-----------'.'</br>';
$create_unix_time = DataConverter::makeTimestamp($list->getCreate());
$diff = $current_time-$create_unix_time;
if ($diff >= 864000) {
echo 'aus db: ' . $list->getErstellt() . '</br>';
echo $list->getId() . '</br>';
echo 'old';
}
else {
}
}
?>
… prints this:
What you say you are getting does look like a regular timestamp rather than a diff:
… prints:
There’s probably a mistyped variable name somewhere in your code.