timesince() difficulties
Permalink
timeSince() doesn't appear to be working for me. What should be something around 30 minutes comes back as 12/31/1969. Essentially,
I know it can be mathematically done, but I thought this was a great function to have at the ready. Any thoughts where I might be missing this?
$myDate = time(); // <- at a previous moment; $elapsedTime = timeSince($myDate,1);
I know it can be mathematically done, but I thought this was a great function to have at the ready. Any thoughts where I might be missing this?
HI,
If you given values then u can get this output.
$dateOfMyPost = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
echo $r = $date->timeSince($dateOfMyPost, 1);
--------------------------
OUTPUT : 2 days, 9 hours
--------------------------
Thank you,
kranthi kumar pulivarthy.
If you given values then u can get this output.
$dateOfMyPost = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
echo $r = $date->timeSince($dateOfMyPost, 1);
--------------------------
OUTPUT : 2 days, 9 hours
--------------------------
Thank you,
kranthi kumar pulivarthy.
For those seeing this: Understanding the difference between a numerical timestamp in milliseconds and a converted timestamp into a string of seconds, minutes, hours, days, months and years is where the solution lies. Read the time functions at php.net. I was unable to get this C5 function to work for me. But there are several other means of traditional solutions - once you understand the difference between numbers and strings in dealing with time.