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
45
Other forums
How can I uploading Transactional Data from Legacy to New SAP system
Hell Gurus,
I am overwhelmed with questions on how to migrate huge volume of Sales Orders
error reporting
hey everyone
I have a production server in which I want error reporting but only on some page
How to show next and prev records
Hi all,
Sorry if this is simple, i'm very new to php, well, any programming language actually
Unable to customise toolbar in FCK
word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor
ereg_replace issue
hi there people
i have this code happening with regards to my wamp server. is this something
PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see
bit of help needed
Im about to sort out my registration page for my website by customising a "registration" s
Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t
Using cURL to PUT
Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code bel