Re: Date Calculation

From: Date: Thu, 28 Oct 2004 19:29:45 +0000
Subject: Re: Date Calculation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200571@lists.php.net to get a copy of this message
That's not quite what I am talking about. I looked at that already. I can could also put the date and time that the script was ran into the MySql database by have a TIMESTAMP field in the database. I would like to compare the date and time of timestamp in the database to the current time and come up with the difference in seconds. Then I could show on the web page that the script was run x many seconds ago. From that I could do the calculations to show that it was x minutes, xhours, etc. On Oct 28, 2004, at 1:52 PM, Jay Blanchard wrote:
[snip] I have a shell script that inserts the unix date and time that the script ran into a MySql database. For example Thu Oct 28 13:41:33 CDT 2004. I would like to have my web page do the math so that it displays the time since the script ran. How can I do the math so that the web page will display something like the script ran 1500 seconds ago. [/snip] http://us2.php.net/manual/en/function.strtotime.php


« previous php.general (#200571) next »