hey guys, new to php, i have 2 submit buttons and i would like that when the 1st button is clicked i get a timestamp for that action and do the same to the 2nd button and will calculate the difference of those timestamps to get the duration taken to click another button.
AKA getting a timestamp for each button click..
timestamp
Moderator: General Moderators
- hypedupdawg
- Forum Commoner
- Posts: 74
- Joined: Sat Apr 10, 2010 5:21 am
Re: timestamp
PHP has function called date(). Useful information can be found on this page here. I would use the date('c') for a timestamp.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: timestamp
Or time(). Easier to subtract.hypedupdawg wrote:PHP has function called date(). Useful information can be found on this page here. I would use the date('c') for a timestamp.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
- hypedupdawg
- Forum Commoner
- Posts: 74
- Joined: Sat Apr 10, 2010 5:21 am
Re: timestamp
Good point - especially when the timestamps are going to be discarded (on a page like this).
Of course, if you're going to need solid records, a date-and-timestamp is worth the effort of exploding it at the other end.
Of course, if you're going to need solid records, a date-and-timestamp is worth the effort of exploding it at the other end.