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

script and html conflict in trying to create a header.
I have an error is occurring because of an html webpage with a "php require" at the top of

PHP5 - Verifying a secure mail is secure
I need to send an e-mail from a form to a external department and because it contains personal custo

need help with date function
i have following form for date

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

UDP server recvfrom() always returns -1? :(
Hello all,
I am getting a very strange error in my code :( I am writing a server application in C

Most basic form question ever?
Hello,

I want to use this snippet to make sure the fields in a form are ok before processing

Display last record first.
I need some help how put the last record first and first record last.

Thanks

Code: &am

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

help with this code please?
Hello,

I am trying to build a remote upload script for my image hosting site.

I am usi

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

PHP and Javascript
Hi Guys,

Im trying to load the contents of an html file into a text area for editing, this is

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