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;
Did you know?Explore Trending and Topic pages for more stories like this.
//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

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

Fetching META TAGS through
Hello everybody
I want to fetch meta tags of a domain.
It will be done from following code of

get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i

simple script won't work. Please help
I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code ex

Hom to make one url to open together with another url
I have a chat, which i want to be opened, as soon as the users login to the site. As it is now, when

GIS appliction help
I found some tutorials in the internet to develop a map application I don't want to use google maps

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

header redirect problems? please help
Ok i am making a site that generates youtube thumbnails and i am generating an image that displays 1

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