I need a quick php datediff function similar to the one in vbscript. I would like the output of datediff function to be “x days, x hours, x minutes, x seconds”. I want the function to accept two mysql and php DateTime values: I also want a third value that flags whether or not we want to calculate the time portion of the DateTime value.
$NowDateTime = 2005-12-02 00:00:00;
$FutureDateTme = 2005-12-02 12:40:03;
$TrimTime = False;
DateDiff($FutureDateTme, $NowDateTime, $TrimTime)
I am aware that some code is available out there but I haven’t been able to find a function that does exactly what I need.
This should only take a good php programmer about 20 minutes consequently I only want to pay $10 - $15 dollars.