This topic is locked

now()

3/18/2011 9:53:33 AM
PHPRunner General questions
W
wclaren author

Does the phprunner function now() take any args? ie: now(d) to display only the date or now(t) to display only the time instead of the default date/time?

E
electromotive 3/20/2011



Does the phprunner function now() take any args? ie: now(d) to display only the date or now(t) to display only the time instead of the default date/time?



The PHPR PHP function now() is defined in include/phpfunctions.php as:

function now()

{

return strftime("%Y-%m-%d %H:%M:%S");

}



It does not accept any parameter. You can extract the date or time from this using PHP or SQL, as you need to.
Or using PHP you can call strftime directly and pass parameters. See http://www.w3schools.com/php/func_date_strftime.asp
Or using SQL see http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_sysdate