for example:
current time - sometime = 10 min. (how to count this?)
when do it like:
$curtime = time();
$diff = $curtime - $sometime;
if return me the UNIX format, but I need to understand how much it is in normal format?
just 10 min. must be 10, not 123124123123.
Php!? How to count a difference between to dates(time), not in UNIX format?
Started by Stasonix, Feb 12 2011 04:22 AM
2 replies to this topic
#1
Posted 12 February 2011 - 04:22 AM
|
|
|
#2
Posted 12 February 2011 - 07:39 AM
#3
Posted 12 February 2011 - 01:17 PM
The Unix timestamp will be of seconds since January 1st, 1970 00:00. You can easily differentiate them, for example $curtime - $sometime will return 7200, 7200 is exactly two hours in seconds from the current time.
echo ($diff / 60) . " minutes";
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









