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 45
Other forums
registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause
problem getting my contact form working
Yeah I know this is a pretty basic problem, but it's been a while since I've worked with PHP and I'm
GET * FROM _____ Except?
I have a site that is for stock photography.
This section of the code calls images to display
Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white pag
Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a
array help
Does anyone know how to require 10 text fields for individual grades and output class average? (10 p
How to get the previous months last date....
Here's my wittle problem. I suck at working with dates.
So today is 10/20/2009, i need to fig
form submit at godaddy?
Trying to test form submission at GoDaddy and it does not seem to work. Here's the page...
h
tag inside php... hi
Code: <?php echo "<td width="$columnWidth%" align=&Display a default image
I am trying to display generic image for items that don't have one, but I can't get it to display.
|