[PHP] date time problem

2013-10-06 Thread Jim Giner
I always hate dealing with date/time stuff in php - never get it even close until an hour or two goes by anyway I have this: // get two timestamp values $exp_time = $_COOKIE[$applid.expire]; $curr_time = time(); // get the difference $diff = $exp_time - $curr_time; // produce a display

Re: [PHP] date time problem

2013-10-06 Thread Farzan Dalaee
You should use gmdate() if you want to how many hours left to expire $time_left = gmdate(H:i:s,$diff); Best Regards Farzan Dalaee On Oct 7, 2013, at 1:49, Jim Giner jim.gi...@albanyhandball.com wrote: I always hate dealing with date/time stuff in php - never get it even close until an

Re: [PHP] date time problem

2013-10-06 Thread Jim Giner
On 10/6/2013 6:36 PM, Farzan Dalaee wrote: You should use gmdate() if you want to how many hours left to expire $time_left = gmdate(H:i:s,$diff); Best Regards Farzan Dalaee On Oct 7, 2013, at 1:49, Jim Giner jim.gi...@albanyhandball.com wrote: I always hate dealing with date/time stuff in

Re: [PHP] date time problem

2013-10-06 Thread Farzan Dalaee
Try this please gmdate(H:i:s, $diff%86400) Best Regards Farzan Dalaee On Oct 7, 2013, at 2:12, Jim Giner jim.gi...@albanyhandball.com wrote: On 10/6/2013 6:36 PM, Farzan Dalaee wrote: You should use gmdate() if you want to how many hours left to expire $time_left = gmdate(H:i:s,$diff);

[PHP] After a PHP script timeout, Apache logs the error but may not cleanly exit the script

2013-10-06 Thread Meta Seller Admin
Hi. I'm wondering if anyone can help with this. We're using PHP and Apache, hosted on a dedicated server running Debian Linux. The specific versions in each case are mostly immaterial, as this problem has been around since Debian 6, and is still present in Debian 7; in the meantime we've been

Re: [PHP] date time problem

2013-10-06 Thread Jim Giner
On 10/6/2013 6:49 PM, Farzan Dalaee wrote: Try this please gmdate(H:i:s, $diff%86400) Best Regards Farzan Dalaee On Oct 7, 2013, at 2:12, Jim Giner jim.gi...@albanyhandball.com wrote: On 10/6/2013 6:36 PM, Farzan Dalaee wrote: You should use gmdate() if you want to how many hours left

Re: [PHP] date time problem

2013-10-06 Thread Farzan Dalaee
Its so freaky Best Regards Farzan Dalaee On Oct 7, 2013, at 2:29, Jim Giner jim.gi...@albanyhandball.com wrote: On 10/6/2013 6:49 PM, Farzan Dalaee wrote: Try this please gmdate(H:i:s, $diff%86400) Best Regards Farzan Dalaee On Oct 7, 2013, at 2:12, Jim Giner

Re: [PHP] date time problem

2013-10-06 Thread Jonathan Sundquist
This should help you out http://stackoverflow.com/questions/365191/how-to-get-time-difference-in-minutes-in-php On Oct 6, 2013 6:07 PM, Farzan Dalaee farzan.dal...@gmail.com wrote: Its so freaky Best Regards Farzan Dalaee On Oct 7, 2013, at 2:29, Jim Giner jim.gi...@albanyhandball.com

Re: [PHP] date time problem

2013-10-06 Thread Aziz Saleh
Jim, The date method takes in a timestamp (not seconds away). You have the seconds, you will need to manually convert those seconds to what you desire (minutes = seconds / 60), (hours = minutes / 60), etc.. Aziz On Sun, Oct 6, 2013 at 7:07 PM, Farzan Dalaee farzan.dal...@gmail.comwrote: Its

Re: [PHP] date time problem

2013-10-06 Thread Jim Giner
Look at my code. The inputs are all timestamps so date should work, no? My question why am i getting an hour value in this case? jg On Oct 6, 2013, at 7:14 PM, Aziz Saleh azizsa...@gmail.com wrote: Jim, The date method takes in a timestamp (not seconds away). You have the seconds, you

Re: [PHP] date time problem

2013-10-06 Thread Aziz Saleh
The resulting subtraction is not a valid timestamp, but rather the difference between the two timestamps in seconds . The resulting diff can be 1 if the timestamps are 1 seconds apart. The linkhttp://stackoverflow.com/questions/365191/how-to-get-time-difference-in-minutes-in-phpJonathan sent out

Re: [PHP] date time problem

2013-10-06 Thread Ashley Sheridan
On Sun, 2013-10-06 at 19:14 -0400, Aziz Saleh wrote: Jim, The date method takes in a timestamp (not seconds away). You have the seconds, you will need to manually convert those seconds to what you desire (minutes = seconds / 60), (hours = minutes / 60), etc.. Aziz On Sun, Oct 6,

Re: [PHP] date time problem

2013-10-06 Thread Jim Giner
On 10/6/2013 7:40 PM, Aziz Saleh wrote: The resulting subtraction is not a valid timestamp, but rather the difference between the two timestamps in seconds . The resulting diff can be 1 if the timestamps are 1 seconds apart. The

Re: [PHP] date time problem

2013-10-06 Thread Jim Giner
On 10/6/2013 7:55 PM, Ashley Sheridan wrote: On Sun, 2013-10-06 at 19:14 -0400, Aziz Saleh wrote: Jim, The date method takes in a timestamp (not seconds away). You have the seconds, you will need to manually convert those seconds to what you desire (minutes = seconds / 60), (hours = minutes

Re: [PHP] date time problem

2013-10-06 Thread Romain CIACCAFAVA
An easier way to do that would be using the diff() method of a DateTime object on another. Regards Romain Ciaccafava Le 7 oct. 2013 à 03:10, Jim Giner jim.gi...@albanyhandball.com a écrit : On 10/6/2013 7:55 PM, Ashley Sheridan wrote: On Sun, 2013-10-06 at 19:14 -0400, Aziz Saleh wrote: