Skip to content
Snippets Groups Projects
Commit edc58e3e authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Add dol_now function

parent 93885de1
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,21 @@
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..');
if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
/**
* \brief Return date for now
* \param mode 'gmt' => we return GMT timestamp, 'tzref' => we use the company timezone
* \return date Timestamp
*/
function dol_now($mode='tzref')
{
if ($mode == 'gmt') $ret=gmmktime();
else if ($mode == 'tzref')
{
// TODO Should use the timezone of the company instead of timezone of server
$ret=mktime();
}
return $ret;
}
/**
* \brief Clean a string to use it as a file name.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment