I’d be happy to help code that does not really work
I want to see if the project was published last month or not.
If yes then get a positive result.
//$project_time="2012-08-01 13:43:49";
$project_time="2012-10-02 14:05:09";
$end=mktime(0,0,0,date("m",strtotime($project_time))+1,date("d",strtotime($project_time)),d ate("y",strtotime($project_time)));
$end=date("d.m.y",$end);
$today=mktime(0,0,0,date("m"),date("d"),date("y"));
$today=date("d.m.y",$today);
echo 'Project date '.$date.'<br />';
echo 'End date '.$end.'<br />';
echo 'Today '.$today.'<br />';
if($today<$end){
echo " open<br />";
}
else{
echo " finish<br />";
}
PROJECT_TIME first gives a good result and the other not.
$ end create date based on $ PROJECT_TIME plus one month.
Variable data TOTDAY get today’s date.
And the comparison I want to get an answer whether past month from PROJECTTIME
If someone has understood and can help I would be happy.
strtotime is the function you want to use. Simply use the following syntax:
EDIT
What people are saying about comparing strings is correct. Don’t compare strings, compare the timestamps.