Check Date/Time in PHP


Posted on 16th Feb 2014 07:03 pm by admin

What I need the code to check is that $reQuest is 24 hours in the past then return a time based on how long ago that was in the past if 24 hours has not passed.
if ($reQuest!=""){
if (is_on_interval($phpdate,$getdate,24)==false){ //24 hours has not passed.
$timePass=false;
//echo $reQuest."<br />"; //debug lines of code
//echo phpversion(); // Installed 5.3.1 but still registered as 5.2.2 --odd
$start = new DateTime($reQuest); //First or start date to be check as pulled from the database.
$time = $start->diff(new DateTime(date("Y-m-d H:i:s", $phptime))); //Check the difference in date with diff() available in 5.3.1
}else{$timePass=true;}
}

The problem is that 5.3.1 did not install properly and being such I am trying to figure out a new way to get the difference in time from the DateTime in the database and the current time obtained by PHP. The $reQuest variable has a value of 2010-02-18 12:47:15
Any help would be appreciated. Thank you

No comments posted yet

Your Answer:

Login to answer
343 Like 45 Dislike
Previous forums Next forums
Other forums

Lack of simpleXML Documentation
What is up with this.

Look at: http://www.php.net/manual/en/function.simplexml-load-file.php<

Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date whi

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

problem with sql querry in php script
Hello guys,

What I want to do is I want to read out a csv file and then but te conent ot the

controlling/creating accounts with privileges
hi all,
i'm trying to figure out how i can create/control account with privileges, for instance a

question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

I hav

Scene graph using Direct3D?
There are several C++ scene graph based packages available for OpenGl, like say OSG,

http://w

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash