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

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

How can you detect variable string in a massive string?
Ok guys, i need some help with this one.

I am going to be getting a large string, like 10-20

Function module "DPS_CHECK_TABLE_EXISTS" not found (after OSS 1422843 impl)
Dear All,

I implemented Note OSS 1422843.

When i execute the new report RSPO20

path to include folder
Hi everyone,

When I'm testing locally, I have to add the name of the site folder as part of t

How to generate a text file using php...?
Hi,
Can anyone give me code to generate a text file using php


Thanks in advance

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

PHP hyperlinks generator
Hi

I need some help to get this done using php:


1 - I have few hyperlinks say 500

jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are

Are sessions secure at all?..
I haven't really gotten into yet, but I was just thinking of something weird..

Lets say you h

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

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