2009-01-30 09:29:31 +01:00
|
|
|
<h1>Origen de tiempo</h1>
|
|
|
|
|
|
|
|
<p>
|
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
|
|
|
What source to use for the time. This can be (for now) either the local system (System) or database (Database).<br /><br />
|
2009-01-30 09:29:31 +01:00
|
|
|
</p>
|
|
|
|
<p>
|
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
|
|
|
This is useful when your database is not on the same system as your webserver or your Pandora FMS servers.
|
|
|
|
In that case any time difference will miscalculate the time differences and timestamps.
|
|
|
|
You should use NTP to sync all your pandora servers and your MySQL server.
|
|
|
|
By using these preferences you don't have to sync your webserver but it's still recommended.
|
|
|
|
</p>
|
2009-01-30 09:29:31 +01:00
|
|
|
<p>
|
|
|
|
Feel free to implement more sources (eg: ntp, ldap, $_SERVER...).
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Note: The database query will be cached the first time it's called so the time will always be the same on a page load throughout, while System time is returned whenever the function is called, which might differ slightly (especially near the ending of a second).
|
|
|
|
</p>
|
|
|
|
<p>
|
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
|
|
|
These examples are all returning Unixtime
|
|
|
|
<script type="text/javascript">
|
|
|
|
var date = new Date; // Generic JS date object
|
|
|
|
var unixtime_ms = date.getTime(); // Returns milliseconds since the epoch
|
|
|
|
var unixtime = parseInt(unixtime_ms / 1000);
|
2009-01-30 09:29:31 +01:00
|
|
|
</script>
|
|
|
|
</p>
|
|
|
|
<p>
|
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
|
|
|
<?php
|
|
|
|
$option = array ("prominent" => "timestamp");
|
|
|
|
?>
|
|
|
|
<b>Current System time:</b> <?php print_timestamp (time (), false, $option); ?>
|
|
|
|
<br />
|
|
|
|
<b>Current Database time:</b> <?php print_timestamp (get_db_sql ("SELECT UNIX_TIMESTAMP()"), false, $option); ?>
|
|
|
|
<br />
|
|
|
|
<b>Your browser time:</b> <script type="text/javascript">document.write (date);</script>
|
|
|
|
</p>
|