Well, Skill, Are you talking about the — $row[lastUpdate] — ??? Is that the date you are talking about?
And, how do you store it in the database? Standard “datetime” format? If you are talking about subtracting
one from the time, I will assume you mean 1 hour? To get the hour you can format it with one of the time
functions in PHP. Like day, hour, etc… And, once you get the hour, you can just subtract one.
So, here are a couple of date/time functions that are easy to use…
// Prints something like: Monday
echo date(“l”);
// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date(‘l jS \of F Y h:i:s A’);
// prints something like: Wednesday the 15th
echo date(‘l \t\h\e jS’);
Here is how to add an hour to the current time…
[php]
<?php
$todayDate = date("Y-m-d g:i a");// current date
$currentTime = time($todayDate); //Change date into time (in seconds)
$timeAfterOneHour = $currentTime+60*60;
echo "
Current Date and Time: ".date("Y-m-d H:i:s",$currentTime);
echo "
Date and Time After adding one hour: ".date("Y-m-d H:i:s",$timeAfterOneHour);
?>
[/php]
Hope that is what you are looking for… Good luck…