Hello,
Below are two examples of different ways to display and compute time.
The first one is in use now. It works fine except, when I go to log the session - last_action, the current format does not match what mysql db requires (0000-00-00 00:00:00)
Any ideas on how I can make this right or achieve something like the second example? I am stumped and could really use your advice on how to do this.
Thank you in advance for your valued time~
[code=php]
// Top example is what I use now..
// Display format = 1209139197
$sessionTimeout= 30; // 30 seconds til timeout
$_SESSION['last_action'] = time(); // Session is set at login
if ((time() - $_SESSION['last_action']) > $sessionTimeout) // Condition for timeout, in members.php
// Second example is how I would like to use it.
// Display format = 0000-00-00 00:00:00
$sessionTimeout= 0000-00-00 00:00:30 // 30 seconds til timeout
$timeNow = date('Y-m-d h:i:s'); // Modified timestamp
$_SESSION['last_action'] = date("Y-m-d h:i:s"); // Session is set at login
if (($timeNow - $_SESSION['last_action']) > $sessionTimeout ) // Condition for timeout, in members.php
[/code]