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

Give me all your tricks for minimizing jar file size

Hi, I'm coming close to releasing my J2ME game... I am kicking up against the 64k size barrier w

How to replace search button with link?
hi to everbody.
i have a search submit form and button like this :

<form id="f

Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into

Simple MySQL query...
Hello,
How could I do a mysql query that does this: SELECT * WHERE date/time < 5minutes ag

Parse String
I need to parse the string below into three variables. How would I do that?

john + 10/20/2008

SWF image using php?
Hello once again.

My latest en devour requires me to produce an image of a static .swf that i

scandir clients directory
hi,
how can i scandir the clients directory? i need a script that when i click a button it will u

switch form actions? not working
i want on submit to go to different pages according to the CatID

Code: <?php $CatID=$_

parse error
On my local machine I keep getting parse error for my footer. When I put it online, it doesn't show

Using Windows message as a Handle
Hi,

I am writing one of my first multithreaded programs.

In one of the thread,

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